Thursday, March 8, 2012
Crystal Report Error
After putting the crystalreportviewer into a form in visual studio .Net, I have choosen the DataBindings properties and type the path of the report source inside. The display in the design window of visual studio can see the report output but when I press F5 to run the debug, the browser came out the following error messge. Does anyone help to solve it?
Thank you.
Server Error in '/WebApplication2' Application.
------------------------
Load report failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Load report failed.
Source Error:
Line 12: <body MS_POSITIONING="GridLayout">
Line 13: <form id="Form1" method="post" runat="server">
Line 14: <CR:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 8px" runat="server" Width="936px" Height="1044px" ReportSource='<%# "C:\Program Files\Microsoft Visual Studio .NET 2003\Crystal Reports\Samples\Reports\General Business\World Sales Report.rpt" %>' SelectionFormula="{Customer.h~~Z}>0">
Line 15: </CR:CrystalReportViewer>
Line 16: </form>
Source File: c:\inetpub\wwwroot\WebApplication2\WebForm1.aspx Line: 14
Stack Trace:
[LoadSaveReportException: Load report failed.]
CrystalDecisions.Web.ReportAgent.h()
CrystalDecisions.Web.ReportAgentBase.set_ReportSource(Object value)
CrystalDecisions.Web.ReportAgent.set_ReportSource(Object value)
CrystalDecisions.Web.CrystalReportViewerBase.set_ReportSource(Object value)
ASP.WebForm1_aspx.__DataBindCrystalReportViewer1(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication2\WebForm1.aspx:14
System.Web.UI.Control.OnDataBinding(EventArgs e)
System.Web.UI.Control.DataBind()
System.Web.UI.Control.DataBind()
System.Web.UI.Control.DataBind()
WebApplication2.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication2\WebForm1.aspx.vb:26
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032If your application is on Windows Server 2003, then try giving 'Read & Execute' authority to the "Network Service" account on your 'Windows\Temp' folder.
If you are using Windows 2000/Xp, then browse to your Documents and Settings folder. There you will find a folder by the name same as your machine name. Go into that folder and assign 'Read & Execute' authority to the 'ASPNET\Local Settings\Temp' folder.
If this doesnt work then try assigning full authority to the above specified folders.
Remeber that this solution will work if your rpts build action is 'Embedded Resource'. I am not sure about the other build actions.
Hope this helps!
Regards!|||i have the same problem
i allready try to change the security permission but it didn't effect
Friday, February 24, 2012
Crosstab question for a "properties" table
Most of the examples for crosstabs use pivot. It looks like aggregations are what they are used for. What about if I have a dynamic properties table. So there is a table Person and a table Property and a table PropertyPersonValue. Is there any way to create a crosstab table of Person with Properties listed in the column heading and the Values in the cells?
Sure, can you post some DDL and sample data?
AMB
|||
CREATE TABLE Person
(
PersonID INT IDENTITY(1,1) NOT NULL,
[Name] VARCHAR(200),
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED (PersonID)
)
GO
CREATE TABLE PersonProperty
(
PersonPropertyID INT IDENTITY(1,1) NOT NULL,
[Name] VARCHAR(200),
CONSTRAINT [PK_PersonProperty] PRIMARY KEY CLUSTERED (PersonPropertyID)
)
GO
CREATE TABLE PersonPropertyValue
(
PersonID INT NOT NULL,
PersonPropertyID INT NOT NULL,
[Value] VARCHAR(1000),
CONSTRAINT [PK_PersonPropertyValue] PRIMARY KEY CLUSTERED (PersonID,PersonPropertyID),
CONSTRAINT [FK_PersonPropertyValue_PersonID] FOREIGN KEY (PersonID)
REFERENCES [Person],
CONSTRAINT [FK_PersonPropertyValue_PersonPropertyID] FOREIGN KEY (PersonPropertyID)
REFERENCES [PersonProperty],
)
GO
INSERT INTO PersonProperty ([Name]) VALUES ('Eye Color')
INSERT INTO PersonProperty ([Name]) VALUES ('Title')
INSERT INTO Person ([Name]) VALUES ('Joe Smith')
INSERT INTO Person ([Name]) VALUES ('Fred Thompson')
INSERT INTO Person ([Name]) VALUES ('Sally Hamilton')
INSERT INTO PersonPropertyValue (PersonID,PersonPropertyID,[Value])
SELECT p.PersonID,pp.PersonPropertyID,'Brown'
FROM Person p,PersonProperty pp
WHERE p.Name='Joe Smith'
AND pp.Name='Eye Color'
INSERT INTO PersonPropertyValue (PersonID,PersonPropertyID,[Value])
SELECT p.PersonID,pp.PersonPropertyID,'Blue'
FROM Person p,PersonProperty pp
WHERE p.Name='Fred Thompson'
AND pp.Name='Eye Color'
INSERT INTO PersonPropertyValue (PersonID,PersonPropertyID,[Value])
SELECT p.PersonID,pp.PersonPropertyID,'Green'
FROM Person p,PersonProperty pp
WHERE p.Name='Sally Hamilton'
AND pp.Name='Eye Color'
INSERT INTO PersonPropertyValue (PersonID,PersonPropertyID,[Value])
SELECT p.PersonID,pp.PersonPropertyID,'CFO'
FROM Person p,PersonProperty pp
WHERE p.Name='Joe Smith'
AND pp.Name='Title'
INSERT INTO PersonPropertyValue (PersonID,PersonPropertyID,[Value])
SELECT p.PersonID,pp.PersonPropertyID,'Vice Presient'
FROM Person p,PersonProperty pp
WHERE p.Name='Fred Thompson'
AND pp.Name='Title'
INSERT INTO PersonPropertyValue (PersonID,PersonPropertyID,[Value])
SELECT p.PersonID,pp.PersonPropertyID,'Sr. Partner'
FROM Person p,PersonProperty pp
WHERE p.Name='Sally Hamilton'
AND pp.Name='Title'
SELECT p.Name,pp.Name AS PropertyName, ppv.Value
FROM Person p
LEFT JOIN PersonPropertyValue ppv
ON p.PersonID=ppv.PersonID
LEFT JOIN PersonProperty pp
ON pp.PersonPropertyID=ppv.PersonPropertyID
|||Try:
declare @.columns nvarchar(max)
declare @.sql nvarchar(max)
set @.columns = stuff(
(
select ',' + cast(quotename([Name]) as nvarchar(max))
from dbo.PersonProperty
order by [Name]
for xml path('')
), 1, 1, '')
set @.sql = N'
select
*
from
(
SELECT
p.Name,pp.Name AS PropertyName, ppv.Value
FROM
dbo.Person p
LEFT JOIN
dbo.PersonPropertyValue ppv
ON p.PersonID=ppv.PersonID
LEFT JOIN
dbo.PersonProperty pp
ON pp.PersonPropertyID=ppv.PersonPropertyID
) as src
pivot
(
min(Value)
for PropertyName in (' + @.columns + N')
) as pvt
order by
[Name]
'
exec sp_executesql @.sql
go
Result:
Be careful with sql injection.
PIVOT on Steroids
http://www.sqlmag.com/Articles/ArticleID/94268/pg/3/3.html
AMB
|||Thanks. So I guess pivot is not really used for this sort of thing.|||
Nope, you are wrong.
He used the PIVOT operator, but he listed or collected all the property values on one variable and given those stored values to your PIVOT operator query...
Print @.SQL
You will get the query which is executed here..
Tuesday, February 14, 2012
Cross database ownership chaining
an option "Allow Cross database ownership chaining"
What is this as i dont find anything in BOL for this
Thanks
SanjayHi Sanjay
Did you update your Books Online for SP3? There is a page about this. Make
sure your BOL title bar says Updated - SP3.
Or you check out this KB article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;810474&Product=sql
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Sanjay" <sanjayg@.hotmail.com> wrote in message
news:08bb01c3a25b$39d3a080$a101280a@.phx.gbl...
> IN Enterpriese manaage on databasse properties tab i see
> an option "Allow Cross database ownership chaining"
> What is this as i dont find anything in BOL for this
> Thanks
> Sanjay|||It was introduced in sp3. Check out the readme that came with sp3.
--
Tibor Karaszi
"Sanjay" <sanjayg@.hotmail.com> wrote in message
news:08bb01c3a25b$39d3a080$a101280a@.phx.gbl...
> IN Enterpriese manaage on databasse properties tab i see
> an option "Allow Cross database ownership chaining"
> What is this as i dont find anything in BOL for this
> Thanks
> Sanjay|||The title bar only says "SQL server Books online"
It says the same on the server machine also where i am
sure SP3 was installed
Anyways on my PC i found a page on "Ownership Chains"
Apart from that am i suppose to have anythng else in BOL
Thanks
Sanjay
>--Original Message--
>Hi Sanjay
>Did you update your Books Online for SP3? There is a page
about this. Make
>sure your BOL title bar says Updated - SP3.
>Or you check out this KB article:
>http://support.microsoft.com/default.aspx?scid=kb;en-
us;810474&Product=sql
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"Sanjay" <sanjayg@.hotmail.com> wrote in message
>news:08bb01c3a25b$39d3a080$a101280a@.phx.gbl...
>> IN Enterpriese manaage on databasse properties tab i see
>> an option "Allow Cross database ownership chaining"
>> What is this as i dont find anything in BOL for this
>> Thanks
>> Sanjay
>
>.
>|||The sp3 update for Books Online is not installed with sp3. It is a separate
download and install.
--
Tibor Karaszi
"Sanjay" <sanjayg@.hotmail.com> wrote in message
news:085a01c3a260$beaaa380$a301280a@.phx.gbl...
> The title bar only says "SQL server Books online"
> It says the same on the server machine also where i am
> sure SP3 was installed
> Anyways on my PC i found a page on "Ownership Chains"
> Apart from that am i suppose to have anythng else in BOL
> Thanks
> Sanjay
> >--Original Message--
> >Hi Sanjay
> >
> >Did you update your Books Online for SP3? There is a page
> about this. Make
> >sure your BOL title bar says Updated - SP3.
> >Or you check out this KB article:
> >
> >http://support.microsoft.com/default.aspx?scid=kb;en-
> us;810474&Product=sql
> >
> >--
> >HTH
> >--
> >Kalen Delaney
> >SQL Server MVP
> >www.SolidQualityLearning.com
> >
> >
> >"Sanjay" <sanjayg@.hotmail.com> wrote in message
> >news:08bb01c3a25b$39d3a080$a101280a@.phx.gbl...
> >> IN Enterpriese manaage on databasse properties tab i see
> >> an option "Allow Cross database ownership chaining"
> >>
> >> What is this as i dont find anything in BOL for this
> >>
> >> Thanks
> >> Sanjay
> >
> >
> >.
> >