Jump to content

Side effect bug on ReportBuilder 15 and UniGui 0.93.0.996


Darth Florus

Recommended Posts

Mr. Farshad:

 

There is a side effect bug when I use Report Builder 15 in combination with UniGui 0.93.0.996.

 

In ReportBuilder we have customized some methods to standarize headers, footers and so on our reports.

 

Until the Report Builder 14.4 there are work wery well. But when we upgrade to RB 15 a bug heads up!.

 

The problems is:

 

The functions UniMainModule and UniApplication point on Nil, only when I execute procedures inside a RB 15 execution of a report.

 

I know that these obviusly is a problem of RB 15, but why the functions UniMainModule and UniApplication point to Null?

 

Its a shame that I can see the hidden code of function UniApplication to peek the probable reason of it.

 

I need of You a advise. What I can do to debug and find the bug considerating I have not the source of UniGui to track and find it?

 

You need a test project with RB 15 components supplied?

 

What I can do?

 

Best Regards

Oscar Flor

Sebaot

Link to comment
Share on other sites

Mr. Farshad:

 

I call these functions inside a custom method of Report Builder.

 

Excactly into the "OnInitializeParameters" from main report.

 

I call a custom function named "InicializarReporteParametros()".

 

Inside I need the current customer ID. This is a custom property of MainModule called "property Aseguradora : TAseguradora".

 

But when I execute the next:

 

<code>

l_titulo := UniMainModule.Aseguradora.IDAseguradora;

</code>

 

UniMainModule is Nil.

 

Inside "function UniMainModule" are some like this:

 

<code>

if UniApplication <> Nil then

  Result := <some code>

else

  Result := UniVCL(<some other code>)

</code>

 

then UniVCL (whatrever) points to nil because is not a VCL application is Web, but UniApplication point to Nil too, there is the problem.

 

I want to know wath happend on function UniApplication but is hidden to me.

Link to comment
Share on other sites

Mr. Farshad:

 

I understand!.

 

Facts:

 

1) The ImprimirReporte (print report) method (thats execute "ReportBuilder.Print", that inside call custom functions) of UniMainModule is called inside a TUniButton.OnClick event.

2) With the same version of UniGui but previous versión of ReportBuilder works. That I say is a side effect bug.

 

Is like the ReportBuilder execute his work inside a protected trhead that insolate it from "public UniGui variables", even if I put the units in the uses clause.

 

To solve this problem (workarround called in spanish a "Banana"; a not well considerated code), I will create a parallel unisession collection and put inside it all my "public" properties hashed by UniSession.Session variable to identify the collection item and put the call of ReportBuilder.Print inside a CryticalSection (serializate calls) to set a public variable with the session id of the caller to identify it inside the custom Report Builder functions, because all access to "UniGui public variables" is not possible.

 

Personally I don't recomend people to use ReportBuilder with UniGui because RB have so much singularity thath slow down developer work. But is a fact that RB have a advanced layout manager that make complex reports (like sales documents, contracts and statisticals analisis) to be possible without Delphi hard programing.

 

Very Thanks for you time to try to solve this bug.

Link to comment
Share on other sites

  • 2 weeks later...

Topic Update!!!

 

Mr. Farshad:

 

I made that I was saying here. I use a paralled UniMainModule object list in the UniServerModule. When a Session inits (MainModule.Create) I add it to the SessionList and the index is copied to my MainModule property Index. When sessión is gone (MainModule.Destroy) I find the index on the SessionList and destroy it.

 

All this operations is maded inside a CriticalSection.

 

Now I can use the new version of ReportBuilder! :)

 

All now work very well!.

 

Best Regards

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...