Report Sharp-Shooter slow preview process


Author
Message
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi, I know this is a RSS issue, but since many SF developers use RSS I will throw it here anyway Hehe

I have this report which is taking about 15-24 seconds to show in my custom preview form, the preview form will show up blank with the "No Report" label (see image RSS slow loading), then the report will be shown normally.

I know that the data is coming out in less than a second, and the preview form is shown without the report, I have not found a way to display a message to the user letting him/her know that the report is being process.  The code to generate the report is splitted in two classes:

  • ServiceCallRouteDataSource.vb will take care of getting the data and pass it to the report with the following code:

'-- Assign the populated datasource from the Dialog Browser to the Report Manager Object.

ReportManagerObject.DataSources.Item(reportDataSourceName) = Me.DataSource

ReportManagerObject.DataSources.Item(reportApplianceDataSourceName) = Me.DataSource.SourceBO.SC_Appliances

'-- Prepare Report to run

ReportManagerObject.Reports(Me.PerpetuumSoftReportName).Prepare()

  • ReportEngine.vb will actually run the report in the custom preview form like this:

Public Shared Function RunReport(ByVal ReportName As FixTrackReports, _

ByVal ReportManagerObject As PerpetuumSoft.Reporting.Components.ReportManager, _

Optional ByVal tBDStringValue As String = "", _

Optional ByVal tEmployeePK As Int64 = 0) As Boolean

     Dim reportDataSourceObject As IReportDataSource

     '-- Get the data source for the report

     reportDataSourceObject = GetReportDataSource(ReportName)

     '-- Populate the data source

     If reportDataSourceObject.PopulateDataSource(ReportManagerObject, tBDStringValue, tEmployeePK) Then

          Dim f As New ReportViewerDialog()

          '-- Set the Report Viewer source with the Report to be used.

          f.rptViewer.Source = ReportManagerObject.Reports(reportDataSourceObject.PerpetuumSoftReportName)

          f.Title = MicroFour.StrataFrame.Tools.Common.GetEnumDisplayValue(ReportName)

          f.TitleDetailText = ""

          f.ShowDialog()

          Return True

     Else

          MicroFour.StrataFrame.Messaging.MessageForm.ShowMessageByKey("NoDataForReport")

          Return False

     End If

End Function

I have other simple reports which generates faster, so I must be missing something in my whole process.  I will appreciate if somebody can see what am I missing here?

Thanks.

Edhy Rijo

Replies
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (10/24/2008)
but I am not sure what this would buy you.  It isn't going to make an performance differences.

Overridable would work in my case, since I will refactor those Custom Properties but since they are used in some forms I don't want to redo the whole thing, I want to refactor them for the report only, to see if I can gain some speed in the process.

Edhy Rijo

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Once again, Trent, Greg thanks a lot.

The slowness was caused by the Custom Field Properties I had in the main BO, following your suggestions I did the following to overcome this issue:

  1. Make my main BO CFP overridable.
  2. In the report's BO I override the CFP using the logic suggested by Greg to create a temp BO with all the lookup data then seek the one requested by the report.

Here is some of my code used:

''' <summary>

''' Use to hold the Appliance Lookup BO

''' </summary>

''' <remarks></remarks>

Private _ApplianceBOLookup As New Business.bizAppliances

''' <summary>

''' The first time this property is used, it will check the

''' lookup BO count > 0 if not it will load all the records

''' Then will use the BO.SeekToPrimaryKey to speed up finding

''' the description value.

''' This method is much more faster than using a Custom Field Property in reports.

''' </summary>

''' <remarks></remarks>

Public Overrides ReadOnly Property [ApplianceName]() As System.String

     Get

          If _ApplianceBOLookup.Count = 0 Then

               _ApplianceBOLookup.FillAllRecords()

          End If

          If _ApplianceBOLookup.SeekToPrimaryKey(Me.FK_Appliances) Then

               Return _ApplianceBOLookup.ApplianceName

          Else

               Return String.Empty

          End If

     End Get

End Property

With the above code the time to render the report was reduced from 37 seconds to 3 seconds.  I still need to figure out how to create my own class to implement the IRenderSite, but know that the report is rendering as it should, I will have more time to get that done.Cool

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Cool Cool
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Nice!
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
I still need to figure out how to create my own class to implement the IRenderSite, but know that the report is rendering as it should, I will have more time to get that done.

Hi Edhy.

Here you have a sample for the IRenderSite:

http://www.perpetuumsoft.com/ForumTopic.aspx?lang=en&topic_id=356&forum_id=9

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ivan,

Thanks for the link, I had downloaded this project sample before, but it did not work for me.  It is in C# and it is generating 2 compiled errors, which I believe are caused because the project was created for an old version of RSS.

I posted a request for a new sample from them, so let's see.  Thanks anyway for keeping this in mind.

Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Yeah, I saw the errors first time I run that sample, but as you said, it was probably a version problem, so you just had to implement the IRenderSite again and all the methods would be created.

Anyway, I used Trent's report sample and added a RenderSite class to it.

Hope it helps.

Attachments
SimpleReportShooterSample.zip (253 views, 1.00 MB)
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ivan,

Thanks a lot for taking the next step and provide the sample.  It is clear now how it is done, without the sample and the poor help file it would be very difficult for me to really understand this.

Now I can have my own WinRenderDialog wich looks more professional and in synch with the application's look and feel.

Thanks again!

Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Glad it helped, Edhy! Cool
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Edhy Rijo - 17 Years Ago
Greg McGuffey - 17 Years Ago
Edhy Rijo - 17 Years Ago
                         [quote]Also, are you show a "generating report dialog" while RSS...
Edhy Rijo - 17 Years Ago
                             Well, this would be a pretty involved post. But in short, it is pretty...
Trent L. Taylor - 17 Years Ago
                                 Thanks Trent, I will keep digging in the issue. One more question if...
Edhy Rijo - 17 Years Ago
                                     You could just make the properties on the base BO overridable and then...
Trent L. Taylor - 17 Years Ago
                                         [quote][b]Trent L. Taylor (10/24/2008)[/b][hr]but I am not sure what...
Edhy Rijo - 17 Years Ago
                                             Once again, Trent, Greg thanks a lot. The slowness was caused by the...
Edhy Rijo - 17 Years Ago
                                                 Cool :cool:
Trent L. Taylor - 17 Years Ago
                                                     Nice!
Greg McGuffey - 17 Years Ago
                                                 [quote]I still need to figure out how to create my own class to...
Ivan George Borges - 17 Years Ago
                                                     Hi Ivan, Thanks for the link, I had downloaded this project sample...
Edhy Rijo - 17 Years Ago
                                                         Yeah, I saw the errors first time I run that sample, but as you said,...
Ivan George Borges - 17 Years Ago
                                                             Hi Ivan, Thanks a lot for taking the next step and provide the...
Edhy Rijo - 17 Years Ago
                                                                 Glad it helped, Edhy! :cool:
Ivan George Borges - 17 Years Ago
Larry Caylor - 16 Years Ago
Edhy Rijo - 16 Years Ago
Larry Caylor - 16 Years Ago
Larry Caylor - 16 Years Ago
Edhy Rijo - 16 Years Ago
Larry Caylor - 16 Years Ago
Edhy Rijo - 16 Years Ago
Larry Caylor - 16 Years Ago
Edhy Rijo - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search