|
-
Aug 23rd, 2006, 07:21 AM
#1
Thread Starter
Member
[02/03] crystal Reports (bundled with VS03)
Hi
Im trying to generate a crystal report at runtime based on datasubmitted from a webform. The report will come from the same tables always but the information from the webform is used in the SQL.
My current method is :
Query the database and use a dataadapter to store the info in a Dataset.
the dataset is not stored not the server as a file, it only exists during runtime (not .xsd)
Then i create a CR at design time pointing at the dataset created in the previous step as its source.
Only problem is the Dataset has no datatables in it to create the report from ! lol
I tryed to get round this using an xml file and writing the dataset to the server. However this isn't perfect as multiple people will be using the application and generating a new xml file for each user would soon take up alot of space
So to some up my question is ...
1) Is there a way in which dynamic crystal reports can be generated based on data submitted?
2) If a file has to be generated can this be removed afterwards?
3) Also i started tooking at hard coding the entire report, is it possible to add tables and data from a seperate SQL using objects in the Crystaldecisions.crystalReports namespace ?
Thanks for your time
Q
-
Aug 23rd, 2006, 11:14 AM
#2
Thread Starter
Member
Re: [02/03] crystal Reports (bundled with VS03)
ok
So i think ive sorted this one myself, cant be sure because i have another error now which stops me from saying y||n
I added a DataSet to the project and designed it to be a template for the input into the CR.
(xsd file)
I then created a new datatable from the schema type and created a new row of that table. It seems its just a matter of setting the CR to point to the Xsd file when creating t through the wizard or set an instance of the reportobject's datasource to a DataSet containing the new table.
This is probably so far off the mark its funny to some, if so could you please tell me where im going wrong ?
The new problem is that i cannot create a report object in my vb code
Dim objCR .....
...
objCR = New CrystalDecisions.CrystalReports.Engine.ReportDocument
objCR.Load("CrystalReport5.rpt")
I keep getting this error :
HTML Code:
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 224:
Line 225: 'Try
Line 226: objCR.Load("CrystalReport5.rpt")
Line 227: ' Catch ex As CrystalDecisions.CrystalReports.Engine.LoadSaveReportException
Line 228: ' debug.WriteLine(ex.Message)
Source File: C:\websites\Core old\EmployeeSurveyRPT\WebForm3.aspx.vb Line: 226
Stack Trace:
[LoadSaveReportException: Load report failed.]
.F(String , EngineExceptionErrorID
)
.B(String , Int32 )
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String reportName, OpenReportMethod openMethod, Int16 parentJob)
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String reportName)
EmployeeSurveyRPT.WebForm3.Button1_Click(Object sender, EventArgs e) in C:\websites\Core old\EmployeeSurveyRPT\WebForm3.aspx.vb:226
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|