vb.net - Adding a subreport to Active Reports -


i'm writing report in vb .net (using active reports) displays details location, , displays bunch of images, stored in database. images displayed in main report via subreport.

however, can't images load. have 2 files, main report (rptmain) , image subreport (rptsubimages). sub detail1_format in rptsubimages never gets ran, why images not appearing, , can't figure out why! i've included code below... can pinpoint why subreport detail section isn't getting called? rptsubimages report gets initialized, if put stop point inside detail sub, never gets caught during debug.

here code:

rptmain:


imports datadynamics.activereports  imports datadynamics.activereports.document  imports system.data imports system.data.oledb  public class rptmain     private rpt rptsubimages      private sub rptmain_reportstart(byval sender object, byval e system.eventargs) handles me.reportstart      end sub      private sub detail1_format(byval sender system.object, byval e system.eventargs) handles detail1.format         me.subreport2.report = rpt          dim cmd new oledbcommand("rptmain")         cmd.parameters.add("@locationid", oledbtype.integer).value = locationid          windows.forms.cursor.current = cursors.waitcursor          dim dslocationinfo dataset = objplugin.getprocdataset(cmd, aquifer.plugin.dataformat.compressed)           '--image         dim dtimage datatable = dslocationinfo.tables(1)         if dtimage.rows.count > 0             rpt = new rptsubimages             subreport2.report = rpt             subreport2.report.datasource = dtimage         end if     end sub end class 

rptsubimages:


imports datadynamics.activereports  imports datadynamics.activereports.document   public class rptsubimages      public sub new()         initializecomponent()     end sub      private sub detail1_format(byval sender system.object, byval e system.eventargs) handles detail1.format         'some text     end sub end class  

solved own problem :) bumped section created , set values of subreport out of detail_format , put in reportstart of rptmain, , voila, loads :) had in wrong part of main form!


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -