Lazarus

Programming => Databases => Topic started by: andersonscinfo on February 28, 2021, 03:14:04 pm

Title: Configure data source via SQLdb in fpreport
Post by: andersonscinfo on February 28, 2021, 03:14:04 pm
Where to find this screen for configuring the data source in fpreport.
Title: Re: Configure data source via SQLdb in fpreport
Post by: af0815 on February 28, 2021, 05:20:58 pm
Normally in the reportdesigner. To found in lazarus/components/fpreport/design/reportdesign.lpr
Title: Re: Configure data source via SQLdb in fpreport
Post by: andersonscinfo on February 28, 2021, 05:58:42 pm
I tried to find it but I couldn't, could you tell me more specifically which way to get to this configuration screen?
this running, in the sources I found, but I'm having trouble setting up a connection to the database.
Title: Re: Configure data source via SQLdb in fpreport
Post by: af0815 on February 28, 2021, 08:06:52 pm
What did you not find ? Your Lazarus installation with the directory components ? Are not able to compile the sources of ReportDesign ?

I compile this and open the Reportdesigner - This is an extra program you have to compile first !!

Reportdesign:
->New Project
-> Menu Report -> Report Data


Links:
https://wiki.freepascal.org/FPReport_Designer
https://wiki.freepascal.org/FPReport
Title: Re: Configure data source via SQLdb in fpreport
Post by: andersonscinfo on February 28, 2021, 08:27:40 pm
I can open the designer, and drag band and components, but I can't set up a connection to sqldb just like the photo on the wiki, I'll post the example.
Title: Re: Configure data source via SQLdb in fpreport
Post by: af0815 on March 01, 2021, 07:29:15 am
which version of fpc and Lazarus do you have ?

I open the designer (NOT in Lazarus Designer !!! - as external Prg !!!)
your project (myreport.json)
Menu -> Report->Report Data
Use the add button (+) and give the Name Data1
After this i can design theconnection


BTW: This was moved by a moderator to Databases, i think it is not the right place, it more a question about fpreport and a Lazarus component question. LazReport have his own area, the newer fpreport not. 
Title: Re: Configure data source via SQLdb in fpreport
Post by: andersonscinfo on March 01, 2021, 11:28:52 am
Quote
which version of fpc and Lazarus do you have ?

laz 2.0.10 fpc 3.2.0
windows 10 pro

Quote
I open the designer (NOT in Lazarus Designer !!! - as external Prg !!!)
your project (myreport.json)
Menu -> Report->Report Data
Use the add button (+) and give the Name Data1
After this i can design theconnection

later I will test, thank you very much for the disposition

Quote
BTW: This was moved by a moderator to Databases, i think it is not the right place, it more a question about fpreport and a Lazarus component question. LazReport have his own area, the newer fpreport not. 

I agree too

Att.

Title: Re: Configure data source via SQLdb in fpreport
Post by: andersonscinfo on March 01, 2021, 09:55:08 pm
well I did the test, here in design time I got it, but already running the app ready, I was unsuccessful, I'm sending a video link if you want to look.

Link: http://activelinux.info/tmp/Gravar_2021_03_01_17_49_40_578.mp4
Title: Re: Configure data source via SQLdb in fpreport
Post by: af0815 on March 02, 2021, 06:31:43 am
First, why did you stop after using the plus sign ? You must give the dataconnection a name, use Data1 as predfined eg.. After this i can select the type of Connection.
Second
I open the designer (NOT in Lazarus Designer !!! - as external Prg !!!)
Title: Re: Configure data source via SQLdb in fpreport
Post by: andersonscinfo on March 02, 2021, 12:18:19 pm
Sorry, I tried now, I am sending another video to show an error when saving the report after executing the configuration.

ps: i'm really grateful to be helping me, i didn't find much material on fpreport, thanks.

http://activelinux.info/tmp/Gravar_2021_03_02_08_09_47_574.mp4
Title: Re: Configure data source via SQLdb in fpreport
Post by: af0815 on March 02, 2021, 07:59:02 pm
The problem is, the designer INSIDE of Lazarus is not able to stream the json into the form (lfm).

I NEVER use the Designer inside Lazarus and i never store the report inside a form. Now i understand your problem. But i am not able to help here. You can only file a bug.

I have my knowledge from the sources and some dicussion on the mailinglist.
Title: Re: Configure data source via SQLdb in fpreport
Post by: thehidden on March 04, 2021, 03:43:41 pm
I can not recommend this way of storing reports.
It gives you many problems with the end user/customer. Latest when he want to change the report.

Do it the "old fashioned" way. Create a separate file with the report.

If you want, create a basic report, convert it to a resource and add it. If somebody deletes the report file it will be rebuild from the compiled resource.

If you have a multi user application, store the report file in a database and read the file from the database. It makes more work, because not all options are in the property register and must be manual coded. But it gives you more flexibility and more freedom with you users/customers.
TinyPortal © 2005-2018