Compiling report

Stimulsoft Reports.NET discussion
Post Reply
Larusso
Posts: 32
Joined: Tue May 20, 2008 9:27 am
Location: Poland

Compiling report

Post by Larusso »

I try to run this code:

ds.Tables.Add(Provider.User1(WebApp.CurrentSession.User.ID))
ds.Tables.Add(Provider.CaseDef(WebApp.CurrentSession.User.ID))
ds.Tables.Add(New Data.DataTable("kredyt"))
ds.Tables.Add(New Data.DataTable("CaseHeader"))
For Each col As Stimulsoft.Report.Dictionary.StiDataColumn In report.Dictionary.DataSources("kredyt").Columns
If col.Type.IsGenericType Then
ds.Tables("kredyt").Columns.Add(col.Name, col.Type.GetGenericArguments(0))
Else
ds.Tables("kredyt").Columns.Add(col.Name, col.Type)
End If
Next
For Each col As Stimulsoft.Report.Dictionary.StiDataColumn In report.Dictionary.DataSources("CaseHeader").Columns
If col.Type.IsGenericType Then
ds.Tables("CaseHeader").Columns.Add(col.Name, col.Type.GetGenericArguments(0))
Else
ds.Tables("CaseHeader").Columns.Add(col.Name, col.Type)
End If
Next
Dim o As Object = report.Dictionary.Relations.Clone()
report.RegData(ds)
eport.Dictionary.Databases.Clear()
report.Dictionary.DataSources.Clear()
report.Dictionary.Relations = DirectCast(o, Stimulsoft.Report.Dictionary.StiDataRelationsCollection)
report.Dictionary.RegRelations()
report.Dictionary.Synchronize()
report.Compile()
report.Render()
kredyt and CaseHeader tables are empty now because they are executed with parameters of web dialog. Unfortunately on compile method it throw exception that no kredytdatasource in caseheader or sthg. I think it's because of relations between them. Help!
Exception:
System.Exception: c:\Documents and Settings\pawels\Ustawienia lokalne\Temp\42ay5lv0.0.cs(233,12) : error CS0117: 'Reports.Report1.kredytDataSource' does not contain a definition for 'CaseHeader'c:\Documents and Settings\pawels\Ustawienia lokalne\Temp\42ay5lv0.0.cs(234,9) : error CS0117: 'Reports.Report1.kredytDataSource' does not contain a definition for 'CaseHeader'c:\Documents and Settings\pawels\Ustawienia lokalne\Temp\42ay5lv0.0.cs(235,9) : error CS0117: 'Reports.Report1.kredytDataSource' does not contain a definition for 'CaseHeader'c:\Documents and Settings\pawels\Ustawienia lokalne\Temp\42ay5lv0.0.cs(236,9) : error CS0117: 'Reports.Report1.kredytDataSource' does not contain a definition for 'CaseHeader'c:\Documents and Settings\pawels\Ustawienia lokalne\Temp\42ay5lv0.0.cs(237,9) : error CS0117: 'Reports.Report1.kredytDataSource' does not contain a definition for 'CaseHeader'c:\Documents and Settings\pawels\Ustawienia lokalne\Temp\42ay5lv0.0.cs(242,17) : error CS0117: 'Reports.Report1.kredytDataSource' does not contain a definition for 'CaseHeader'c:\Documents and Settings\pawels\Ustawienia lokalne\Temp\42ay5lv0.0.cs(249,13) : error CS0117: 'Reports.Report1.kredytDataSource' does not contain a definition for 'CaseHeader'
Its because of code in data rendering like this:
if (kredyt.CaseHeader.CurrentState == "raz" ||
kredyt.CaseHeader.CurrentState == "dwa" ||
kredyt.CaseHeader.CurrentState == "trzy" ||
kredyt.CaseHeader.CurrentState == "cztery")

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Compiling report

Post by Vital »

Hello Larusso,

Its very hard check your code without your report, but i think problem in relations. Please check that relation CaseHeader have "CaseHeader" in Name property. You can insert method report.Design instead method compile to see what you receive in report and what wrongs.

Thank you.
Post Reply