I am trying to create a crystal report, but I want the connection string that I have mentioned in the Web.Config file to be accessed. Also, I want to create an xsd file for my crystal report file to refer. Can someone please direct me to a tutorial or forum to solve my problem?
标签:
crystal-reports
相关问题
- Crystal Report SP26 SetDataSource() Method failed
- Crystal Report in .NET Framework 4.0
- right to left string in crystal report
- Loading Crystal Report from embedded resource
- Suppress Nonadjacent Duplicates in Report
相关文章
- What is the best way to cleanup the resources used
- How to pass a list of values into a crystal report
- Crystal Report Sub Report Page Break
- Issue related to vertical line in Crystal Reports
- Dynamically change database type, source etc in Cr
- Converting total time in integer into HH:MM format
- Crystal Report: How to evaluate multiple IF statem
- How to resolve Crystal Report version conflict and
you can also programatically set the report data source if you need to - I can provide details if you require
between calling myReportDocument.Load("myreport.rpt") and myReportDocument.Refresh() (the latter of which actually gets the data from the database) it is possible to add a call to myReportDocument.SetDataSource(myDataSource) which takes an object of data source type, which you can create, with a call to its constructors, with the URL of the data source you wish to use, its username and password.
Hope this helps
Thank you all for helping me out. I am now able to display data in the crystal report file using the XSD file. The xsd file has fields which are exactly the same name as mentioned in the select query that is bringing values from DB. The following is the part of the xsd file that contains the field names in the xs:element tag.
The datatypes of these fields , also needs to be mentioned. The XSD file name can be kept as desired. The name "Summary_Report_on_portal" and "Summary_Updt" does not correspond to any dataset name in code behind or query fields. It can be kept as per the user's wish.
This XSD file needs to be referred into the crystal report, using the Database Expert in the Field Explorer window. The "Summary_Updt" name is visible in the new connections , which can be added to the crystal report. The fields mentioned in the xs:element field are visible for the user to drag and drop into the crystal report. When the user mentions the data source to the crystal report(dataset), the fields in the dataset are matched with the XSD field values. CODE: objBL.Rpt.SetDataSource(objBL.ds_shipment_info.Tables[0]);
Hope this is detailed enough. Let me know if anyone wants more info
a different way would be to call ReportDocument::SetDatabaseLogon (String * user, String * password, String * server, String * database); before Refresh(); if you don't want to reuse a connection. This has the benefit of being simple but means that you dont reuse data sources.