Compiling report
Posted: Fri Jun 20, 2008 1:53 am
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")
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")