Page 1 of 1
Blank Report?
Posted: Tue Feb 23, 2010 12:20 pm
by marine88
I have this code. But Still get nothing in viewer its just a blank report. Did I miss something?
Chged it to this:
sqlcon.Open()
Dim sql1 As String
Dim da As SqlDataAdapter
Dim ds As New DataSet
sql1 = "select ID,Deliverables,To_PM from PM70.Synopsis_Deliverables where(Estimate_Number=" & test & ")"
da = New SqlDataAdapter(sql1, sqlcon)
report.Load(Server.MapPath("~/Forms/Work_Orders/Photoworkorderprint.mrt"))
ds.Tables.Add("Synopsis_Deliverables")
da.Fill(ds, "Synopsis_Deliverables")
report.DataSources.Clear()
report.Dictionary.Databases.Clear()
'report.RegData("PM1", ds.Tables("Synopsis_Deliverables"))
report.RegData("Synopsis_Deliverables", ds)
report.Dictionary.Synchronize()
report.Compile()
'report.Render(True)
StiWebViewer1.Report = report
Blank Report?
Posted: Tue Feb 23, 2010 12:32 pm
by Brendan
In your Work_Orders/Photoworkorderprint.mrt report template, what is the 'Name In Source' value set as for your Datasource?
The code posted below looks like it is expecting the Name In Source to be "Synopsis_Deliverables.Synopsis_Deliverables"
Blank Report?
Posted: Tue Feb 23, 2010 1:04 pm
by marine88
Thanks!!! That was it! WHEW!
Blank Report?
Posted: Tue Feb 23, 2010 1:05 pm
by marine88
THIS WORKED. But...if I am setting datasource to nothing then why do I need to even have a datasource set if I am using another query in code?
sqlcon.Open()
Dim sql1 As String
Dim da As SqlDataAdapter
Dim ds As New DataSet
sql1 = "select ID,Estimate_Number,Deliverables,To_PM from PM70.Synopsis_Deliverables where(Estimate_Number=" & test & ")"
da = New SqlDataAdapter(sql1, sqlcon)
report.Load(Server.MapPath("~/Forms/Work_Orders/Photoworkorderprint.mrt"))
ds.Tables.Add("Synopsis_Deliverables")
da.Fill(ds, "Datasource1")
report.Dictionary.Databases.Clear()
report.DataSources.Clear()
report.RegData("PM1", ds.Tables("Synopsis_Deliverables"))
report.RegData("Datasource1", ds)
report.Dictionary.Synchronize()
report.Compile()
'report.CompiledReport.DataSources("Datasource1").Parameters("Estimate_number").ParameterValue = test
'report.Render(True)
StiWebViewer1.Report = report
Blank Report?
Posted: Tue Feb 23, 2010 1:35 pm
by Brendan
There are many ways to use StimulReports.
One way is for it to have it pull the data from a datasource for you (SQLServer, Access, Oracle, etc).
The other way is for you to push data into it as a datasource (DataTables, DataSets, Object collections, etc)
I'm not sure how you are using it, but if you have SQL Connections and SQL Data sources in your report template then instead of passing in a dataset you can just alter the report template's Sql connection string at runtime, set your parameters for your datasources and let StimulReports fetch the data for you and register the data for you.
The other approach is to fetch the data yourself in code from your DB and then register that data as a Datasource in the report.
Blank Report?
Posted: Tue Feb 23, 2010 2:51 pm
by marine88
So I am doing the fetch data with my own datasource. Is there a reason why th eprint page will not display.
Blank Report?
Posted: Tue Feb 23, 2010 5:02 pm
by Edward
Hi
If possible to send sample report and data to support[at]stimulsoft.com, I think we could help you to find the reason of blank pages asap.
Thank you.
Blank Report?
Posted: Wed Feb 24, 2010 9:55 am
by marine88
Thanks. I should have phrased that correctly meaning Print Preview does not work. I am using demo if thats the issue. My other question is do I need to have a datasource selected in the IDE for the report or can I programatically state that in my code without the need to create the Datasource.clear() method. I uploaded my test report that I am testing with. I will upload one of my pages with crystal reports in it that I did so that you get an idea of what I am trying to accomplish.
Blank Report?
Posted: Wed Feb 24, 2010 8:10 pm
by Edward
Hi
Thank you very much for the samples.
I have sent reply to you by Email.