Trying to use an already present sqldatasource for a local VS.NET crystal report

Posted on 2009-04-15
Medium Priority
Last Modified: 2012-05-06
VB/ASP.NET 2.0: I already have a sqldatasource which calles a stored proc that accepts control parameters for a filtered search. The results are displayed in a gridview. I want these same results displayed in a LOCAL crystal report (the CR that's intergrated within VS.NET) instead of the gridview. How do I bind this same existing sqldatasource to a local crystal report? I'd like to have this binding in a button click and also pdf exporting in a different button.
Question by:techpr0
  • 3
  • 2

Author Comment

ID: 24158348
Ok, I was able to connect my SQLDataSource to my CrystalReportSource and then my CrystalReportViewer to my CrystalReportSource which I discovered I orginally was doing correctly but thought I wasn't because I couldn't find the data the SQLDataSource returns in my report within the Server Explorer nor with the Database Expert. I found it here: http://msdn.microsoft.com/en-us/library/ms227820(VS.80).aspx . Now my problem is accessing the data from my SQLDataSource from the Server Explorer to build my report. Can you please show me how to find this???
LVL 101

Expert Comment

ID: 24158853
Check this method of feeding your report from the application



Author Comment

ID: 24159963
Thanks for your effort mlmcc but... I've only read half of it but it appears this article is about binding a crystal report to a dataset; I'm looking to bind my report to a asp.net/vb.net 2.0 SqlDataSource. Any more suggestions?
LVL 101

Expert Comment

ID: 24174013
It is about that.  COuld you create the dataset then bind it.


Accepted Solution

techpr0 earned 0 total points
ID: 24177977
sqldatasource doesn't appear anywhere in the article. Plus, I know it would have worked if I "COuld you create the dataset then bind it" but that was why I submitted this post to find out how to do it. I did figure out how to convert a sqldatasource into a dataset but it wasn't mentioned in your article:

DataView view = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);

DataTable table = view.ToTable();
DataSet ds = new DataSet();

But I ended up not doing it this way. I ended up doing it like this: http://www.codeproject.com/KB/cs/VMCrystalReports.aspx?msg=3007117#xx3007117xx 
Worked perfect! I didn't even have to use a dataset. Thanks any way mlmcc.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month16 days, 15 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question