How to filter the data ?

Hello,

I am looking for the solution how to display the data in the underlying tables only for the selected topic via combobox or data selector.

I have hierarchical structure in my database.

Design of the report: also in hierarchical databands
data1
data2
data3 etc.

To display the report I have a button with this code:

Report4.RegisterData(Me.OperaDS, "operaDS")

Try

Dim db1 As FastReport.DataBand = DirectCast(Report4.FindObject("Data1"), FastReport.DataBand)
db1.DataSource = Report4.GetDataSource("projet")

Dim db2 As FastReport.DataBand = DirectCast(Report4.FindObject("Data2"), FastReport.DataBand)
db2.DataSource = Report4.GetDataSource("chapCCTPpro")

Dim db3 As FastReport.DataBand = DirectCast(Report4.FindObject("Data3"), FastReport.DataBand)
db3.DataSource = Report4.GetDataSource("CCTPCatpro")
Dim db4 As FastReport.DataBand = DirectCast(Report4.FindObject("Data4"), FastReport.DataBand)
db4.DataSource = Report4.GetDataSource("CCTPPrestpro")
Report4.Dictionary.UpdateRelations()


Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
Me.Report4.Show()

End Try

Me.Report4.Dispose()

The report shows all the data . I need to display only the data for the selected project.
Using the combobox or the data selector changes only the name of the project , but not the data in the next tables.

Thanks

Comments

  • edited 11:46AM
    Hello,

    Could you attach your report file (.frx) here (or send it to tz@fast-report.com)?
  • edited 11:46AM
    After adding of "Dim report4 As New FastReport.Report" before mon code

    I am able to select my data via the data selector.

    Now I can see my data only one time, if I want to change the name of the project 2th time

    I have an error " Object reference not set to an instance of an object" and in Visual Studio "System.NullReferenceException".

    I will attach the report file later ( The upload is not working)

    I like the fast report and I hope you will help me to fix this little problem.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.