473,849 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get the Crystal Reports Viewer to bind with my dataset.

I am in the same boat as Moondog on the 2nd July.
I have a report designed against a dataset.
Proved the datasset is OK by dropping a datagrid onto the form and it binds
OK to the data.
But the report is empty (except for headers). My method is similar to
Moondog except the dataset is based on a SProc.
The dataset is instantiated in FormA, passed to a DataHandling class which
fills it. by executing the SProc
it is then passed to the report form in the constructor.
The constructor then passes it down to a subroutine 'loadreport' which
attempts to bind it to the report viewer
Code is :
Private Sub loadreport(ByRe f dsevents As dsReportEvent)

' Called by new(ByRef dsevents As dsReportEvent)

Me.dg1.DataSour ce = dsevents

Me.dg1.DataMemb er = "Table"'Datagri d sanity check

mRpt = New rptEventReport 'report class underlying report based on dsEvents

mRpt.SetDataSou rce(dsevents)

Me.crvMain.Repo rtSource = mRpt 'setting the viewer

End Sub

Any help would be appreciated.
Thanks
Bob
Nov 20 '05 #1
3 5974
Hi Brian,
Thanks for your reply.
No Joy.
I coded:
Private Sub loadreport(ByRe f dsevents As dsReportEvent)

Dim crReportDocumen t As rptEventReport

crReportDocumen t = New rptEventReport

Dim ds As DataSet

ds = dsevents 'NOTE here I am still pointing to my original dataset.

Dim dstest As String = ds.GetXml 'dstest shows well formed doc with data

crReportDocumen t.SetDataSource (ds)


Me.crvMain.Repo rtSource = crReportDocumen t

Me.crvMain.Visi ble = True

End Sub

The test string showed an xml doc with data.

I do have dates in the data.
I'll alter the sproc / dataset / report to give a one integer field rowset
and see if that helps.
If it does then I'll build up from there.
If it is data then this control is not much use.
Is there any 3rd party viewer around that anybody knows of?
Thanks
Bob

"BrianDH" <Br*****@discus sions.microsoft .com> wrote in message
news:7E******** *************** ***********@mic rosoft.com...
Try this.
Dim crReportDocumen t As rptEventReport
crReportDocumen t = New rptEventReport
Dim dsevents As DataSet = "get your dataset values"
Dim strTests As String = dsevents.GetXml ' break point here view/test your DS XML crReportDocumen t.SetDataSource (dsevents)
CrystalReportVi ewer1.ReportSou rce = crReportDocumen t
CrystalReportVi ewer1.Visible = True

If this does not work.
Question: Are you using any formulas? running totals? also date time fields can give you fits with CR.
hope that helps.

B
"Bob Clegg" wrote:
I am in the same boat as Moondog on the 2nd July.
I have a report designed against a dataset.
Proved the datasset is OK by dropping a datagrid onto the form and it binds OK to the data.
But the report is empty (except for headers). My method is similar to
Moondog except the dataset is based on a SProc.
The dataset is instantiated in FormA, passed to a DataHandling class which fills it. by executing the SProc
it is then passed to the report form in the constructor.
The constructor then passes it down to a subroutine 'loadreport' which
attempts to bind it to the report viewer
Code is :
Private Sub loadreport(ByRe f dsevents As dsReportEvent)

' Called by new(ByRef dsevents As dsReportEvent)

Me.dg1.DataSour ce = dsevents

Me.dg1.DataMemb er = "Table"'Datagri d sanity check

mRpt = New rptEventReport 'report class underlying report based on dsEvents
mRpt.SetDataSou rce(dsevents)

Me.crvMain.Repo rtSource = mRpt 'setting the viewer

End Sub

Any help would be appreciated.
Thanks
Bob

Nov 20 '05 #2
OK Problem Solved.
You have to use the overloaded version of the dataadapter fill command.
ie.
Dim cmdConn As New SqlClient.SqlCo mmand("proc_Get EventReportData ",
NewSqlClient.Sq lConnection(str Connection))

cmdConn.Paramet ers.Add(New SqlClient.SqlPa rameter("@strID List",
SqlDbType.NVarC har))

cmdConn.Paramet ers("@strIDList ").Value = mstrUnitList
cmdConn.Command Type = CommandType.Sto redProcedure
Dim da As New SqlClient.SqlDa taAdapter(cmdCo nn)
Dim ds As New dsReportEvent
da.Fill(ds, "ReportEven t")
Dim rd As New rptEventReport
rd.SetDataSourc e(ds)

The big 'break through' was realising that "ReportEven t" was needed.
The documentation alludes to this but leaves the impression that is it
mainly for table verification.
This HAD to be the name of the Element that was inside my typed dateset.
My element was handrolled and not actually a table so it seemed
reasonable to use the default constructor and accept the generated table
name "Table".
Alas no.
Moondog, if your out there, good luck.
regards
Bob

Bob Clegg wrote:
Hi Brian,
Thanks for your reply.
No Joy.
I coded:
Private Sub loadreport(ByRe f dsevents As dsReportEvent)

Dim crReportDocumen t As rptEventReport

crReportDocumen t = New rptEventReport

Dim ds As DataSet

ds = dsevents 'NOTE here I am still pointing to my original dataset.

Dim dstest As String = ds.GetXml 'dstest shows well formed doc with data

crReportDocumen t.SetDataSource (ds)


Me.crvMain.Repo rtSource = crReportDocumen t

Me.crvMain.Visi ble = True

End Sub

The test string showed an xml doc with data.

I do have dates in the data.
I'll alter the sproc / dataset / report to give a one integer field rowset
and see if that helps.
If it does then I'll build up from there.
If it is data then this control is not much use.
Is there any 3rd party viewer around that anybody knows of?
Thanks
Bob

"BrianDH" <Br*****@discus sions.microsoft .com> wrote in message
news:7E******** *************** ***********@mic rosoft.com...
Try this.
Dim crReportDocumen t As rptEventReport
crReportDocum ent = New rptEventReport
Dim dsevents As DataSet = "get your dataset values"
Dim strTests As String = dsevents.GetXml ' break point here view/test your


DS XML
crReportDocum ent.SetDataSour ce(dsevents)
CrystalReport Viewer1.ReportS ource = crReportDocumen t
CrystalReport Viewer1.Visible = True

If this does not work.
Question: Are you using any formulas? running totals? also date time


fields can give you fits with CR.
hope that helps.

B
"Bob Clegg" wrote:

I am in the same boat as Moondog on the 2nd July.
I have a report designed against a dataset.
Proved the datasset is OK by dropping a datagrid onto the form and it
binds
OK to the data.
But the report is empty (except for headers). My method is similar to
Moondog except the dataset is based on a SProc.
The dataset is instantiated in FormA, passed to a DataHandling class
which
fills it. by executing the SProc
it is then passed to the report form in the constructor.
The constructor then passes it down to a subroutine 'loadreport' which
attempts to bind it to the report viewer
Code is :
Private Sub loadreport(ByRe f dsevents As dsReportEvent)

' Called by new(ByRef dsevents As dsReportEvent)

Me.dg1.DataS ource = dsevents

Me.dg1.DataM ember = "Table"'Datagri d sanity check

mRpt = New rptEventReport 'report class underlying report based on
dsEvents
mRpt.SetData Source(dsevents )

Me.crvMain.R eportSource = mRpt 'setting the viewer

End Sub

Any help would be appreciated.
Thanks
Bob


--
Please take out the garbage before using reply address.

Nov 20 '05 #3
Hmmm, I think I did try that method bclegg, but still had no luck.

But I did manage to get it working. Here's how:

In my code after I get my dataset I run this line once:

myDataSet.Write XmlSchema("C:\M yReport.xsd")

This creates a file called MyReport.xsd that contains the description
of my data. Next I create a new Crystal Report using MyReport.xsd as
my ADO.NET (XML) source. Once the new report is created you can
delete MyReport.xsd, and also delete the line of code that created the
xsd file. The new report created will then accept my dataset during
runtime.

Dominic Isaia (Moondog)
di****@earthlin k.net
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
14313
by: Rick Thiel | last post by:
Hello, I am trying to build a Crystal report VisualStudio.NET for an ASP.NET application. I would like to build a report that doesn't connect to any particular database at design time because I am planning to pass a dataset to the report at runtime. From what I have read, it sounds like unbound fields might be the answer. However, I am having trouble figuring out how to bind these unbound fields to my dataset at runtime.
0
426
by: Jason | last post by:
We are developing a VB.NET database application, using windows forms and Microsoft Access. The application requires dynamic reports, where the users change data on the forms, if a report is being shown it will automatically update. To do this we are using the .NET crystal report viewer, which loads a crystal report that we set it's data source at runtime using a dataset. If the user changes data on the data collection form, we update...
2
2342
by: Jonathan | last post by:
Hi all, It's my first post here, so be kind :) I got a little application that keep track of a small inventory, everything was going great until came the time to make some types of reports. I want to use Crystal Reports in the background to generate the reports for me, i don't want any preview, any popup (only a print dialog then send it to the selected printer). That should be pretty easy ;) First of all, my app doesnt make any use of...
3
2161
by: Khurram | last post by:
Hi, I am trying to use Crystal Reports with ASP.NET. I created a dataset and tried to display it in the report but nothing came up. I did not get an exception either. I know that the dataset is populated so it has to be a very basic binding issue. To bind the report object to dataset I called the SetDataSource method of Report object with dataset as the parameter.
0
366
by: Moondog | last post by:
Here's my VB.NET code: Dim RV As New frmReportViewer 'This is the form containing the 'Crystal Report Viewer Dim Rep As New DetailsReport 'DetailsReport is the name of my 'report. It is already imported 'into my project Rep.SetDataSource(myDataset) 'myDataset is correct and has the
0
1684
by: Monali | last post by:
Hi, I created a ASP.NET crystal reports web site in VS 2005. I wanted to display the data in a DataSet in the Crystal Reports viewer control. I am getting the DataSet from another dll. The documentation says that I need to add a new item - Crystal report, with a blank report in the project which will automatically create a class say CrystalReport1 in my project (if the name of the crystal report added is CrystalReport1.rpt). I should...
2
6175
by: Simone | last post by:
Hello I am new to this :) I have created a crystal reports and tried using the Crystal Report Viewer but when I try to preview the report it prompts me for a user name and password. I am using a dataset (table adapter) that is linked to a string connection in my config file that has the user name and password saved to my sql server. why is it prompting the login??
6
2489
by: Simone | last post by:
Hello Here is my issue, I created a crystal report using a data set from my xsd. Then I created a page with the crystal report viewer control and bound the report to it. When I try to view the report on the browser I get a logon page even though my dataset has a connection string saved within it. When I preview the data in the dataset I see it no problem. however the report doesn't seem to know that the dataset is there or that the
6
1634
by: Bjorn Sagbakken | last post by:
Hi I have done some work with VS 2005 but no report-issues yet. Now I want to step up, and implement reports for printing and PDF export. I have just briefly studied the build-in report generator in VS 2005, and this seems more than sufficient at the moment. But still I would like to have some advice; should I move to Crystal Reports for improved performance? The question may be lacking substance about the complexity in the report,
0
869
by: newkhan | last post by:
Hi, I have worked with RDLC reports on visual studio.net 2005 and now i am using crystal reports. I want to add data from single table using ado.net and in the crystal report I have added the database tables but on preview no data is shown. Is it not possible to display data on crystal reports without temporary table. In RDLC report we add database fields and on the properties of report viewer we slect the report and the instance of...
0
11005
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10665
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9501
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7070
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4139
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.