Edhy Rijo
|
|
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  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.DataSourceReportManagerObject.DataSources.Item(reportApplianceDataSourceName) = Me.DataSource.SourceBO.SC_Appliances'-- Prepare Report to runReportManagerObject.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 IfEnd 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
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Thanks Greg, will start testing with those approaches to see which one give me the best result.
Edhy Rijo
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Also, are you show a "generating report dialog" while RSS is generating the report? They have one by default that you can show Trent, I have been looking in RSS help file and could not find any reference to this dialog or how to make my report use the default one. RSS site seems to be down, if possible could you tell me how to make use of the default dialog?
Edhy Rijo
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Well, this would be a pretty involved post. But in short, it is pretty much like I mentioned it. The IRenderSite implementation just allows you to create a hook and call it when you call the Prepare method on the ReportSlot. It also has events that you can handle indicating what is going on (i.e. compiling scripts, etc.) so that you can notify your end-user of the status. I am about to walk into a developer session and will be offline for a while, but if you don't make any progress let me know and I will try and give some more details.
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Thanks Trent, I will keep digging in the issue. One more question if you don't mind I have some Custom Field Properties (CFP) in the main BO, which when using the BBS builder, will create a report bo inheriting the main bo and then will have those CFP, is there any way to remove those CFP from the report BO?
Edhy Rijo
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
You could just make the properties on the base BO overridable and then override them in the report BO. You coudl then apply the <Browsable(False)> and <Bindable(False)> attributes and possibly several others to make them hidden, but I am not sure what this would buy you. It isn't going to make an performance differences. And if your end-user cannot modify the report, then this would be a non-issue.
|
|
|
Edhy Rijo
|
|
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
|
|
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: - Make my main BO CFP overridable.
- 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 GetEnd 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.
Edhy Rijo
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Cool
|
|
|
Greg McGuffey
|
|
Group: Forum Members
Posts: 2K,
Visits: 6.6K
|
|
|
|
Ivan George Borges
|
|
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
|
|
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
|
|
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.
|
|
|
Edhy Rijo
|
|
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
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Glad it helped, Edhy!
|
|
|