Topic: Logo

hello friends..
how to load logo from database on report..
see image

Post's attachments

Attachment icon logo.zip 21.83 kb, 366 downloads since 2018-12-23 

Re: Logo

can anyone help??

Re: Logo

blackpearl8534 wrote:

can anyone help??

https://downloader.disk.yandex.ru/preview/29f17502ab6b2e3b1c504f4cf0f7400c8c3831ed3cee60fc3ea4fe70d3b0ee84/5c20e278/VcxU0P_nauZ4EcQJ8f84IFsHJxWCK5BnW9tBLLrBL4IUwTjjZpVyOSj8stAD5lWYFU22ilrUXEveny-dHbni1w%3D%3D?uid=0&filename=234233.jpg&disposition=inline&hash=&limit=0&content_type=image%2Fjpeg&tknv=v2&size=2048x2048

4 (edited by blackpearl8534 2018-12-24 16:04:53)

Re: Logo

not works.. i want to load Picture from Database...
need script....

Post's attachments

Attachment icon logo.JPG 78.07 kb, 189 downloads since 2018-12-24 

5 (edited by blackpearl8534 2018-12-24 16:21:18)

Re: Logo

software shows this message

Post's attachments

Attachment icon untitled.JPG 10.26 kb, 164 downloads since 2018-12-24 

6 (edited by sibprogsistem 2018-12-24 16:29:39)

Re: Logo

procedure report (sender: string);
var
    frxDBDataset1: TfrxDBDataset;
    image: TDataSet;

begin

    SQLQuery('SELECT column AS "image" FROM dbName WHERE id='+form1.tablegrid1.sqlValue , image);

    frxDBDataset1 := TfrxDBDataset.Create(frmLogin);
    frxDBDataset1.UserName        := 'dbimage';
    frxDBDataset1.CloseDataSource := True;
    frxDBDataset1.OpenDataSource  := True;
    frxDBDataset1.DataSet         := image;

    frmLogin.frxReport.Clear;
    frmLogin.frxReport.DataSets.Clear;
    frmLogin.frxReport.DataSets.Add(frxDBDataset1);

    frxDBDataset1.DataSet.Close;

            frmLogin.frxReport.LoadFromFile(ExtractFilePath(Application.ExeName)+'report\image.fr3');
            frmLogin.frxReport.ShowReport;


       frxDBDataset1.Free;



end;

7 (edited by thezimguy 2018-12-24 16:31:43)

Re: Logo

You can also do it without writing script. Check whether this helps

Post's attachments

Attachment icon logo_fixed.zip 580.69 kb, 389 downloads since 2018-12-24 

@thezimguy

Re: Logo

thanks .. thats good but i am using logo on fuel receipt... i have only one logo to print on all reports.. so any way to load directly from database to Receipt.. i am also loading Name, address , contact and Footer text.. but on image .. software throws an error.. that i posted in previous post...

Re: Logo

You can still do it. I will send you another sample soon.

@thezimguy

Re: Logo

Hi Raheel, Zimguy, Sibprogsistem,
I don't use the ReportDesigner much but whenever I've wanted to use any pictures (as in your example, for a logo), then I simply add the picture(logo) directly into the Reports folder within my project.  Then, in the ReportDesigner, I drag a 'picture object' into whatever section of the report I want and then specify the picture I want to load. 
Because, in this instance, it's simply a picture(logo) and unrelated to any data, it's actually nothing to do with MVD and all done within the Reporter.
Regards,
Derek.

Post's attachments

Attachment icon logo.zip 1.59 mb, 354 downloads since 2018-12-24 

11 (edited by blackpearl8534 2018-12-25 10:06:19)

Re: Logo

thanks DEREK...
i am using this type of receipt.. but to change logo .. we have to open report designer..
so i want to change logo by adding logo in database....
i think Dmitry can help but i think he is not available these day...

Re: Logo

Hello Dmitry.. looking for you ...
i have a problem... can you help???

Post's attachments

Attachment icon untitled.jpg 57.79 kb, 171 downloads since 2018-12-26 

Re: Logo

Form1.DBImage1.LoadFromDatabase('Receipt', 'Logo', 1); 
Dmitry.

14 (edited by blackpearl8534 2018-12-26 19:44:24)

Re: Logo

Sorry Dmitry...
please explain.. how to write...
i am writing script in report designer...
Here ReceiptForm is not a main form..  its a subForm..

Post's attachments

Attachment icon untitled.jpg 91.88 kb, 154 downloads since 2018-12-26 

Re: Logo

Please attach your project.

Dmitry.

Re: Logo

Hello Dmitry.....
I attached my Project..
i am loading Header text and footer text from database by scripting in Report designer...
but i can't load logo... you can see in project..

Post's attachments

Attachment icon logo.zip 447.45 kb, 333 downloads since 2018-12-27 

17 (edited by derek 2018-12-28 13:29:59)

Re: Logo

Hello Raheel,
I understand what you're trying to do - load the dbimage into the 'picture' object in Fastreport by script.  But like you, I can't work out what the correct syntax should be.
As a work-around, and because you only ever have 1 row in your 'receipts' table, I would simply create a relationship between your 'database' table and your 'receipt' table, pre-set form1.combobox2 to '1' (using index1) and hide it;  that way,  the logo (and the header and footer messages) can be added as data fields to the dataset that you define for the report in the standard way.
I don't know if that's an acceptable solution for you?
Derek.

Post's attachments

Attachment icon logo2.zip 571.75 kb, 351 downloads since 2018-12-28 

18 (edited by blackpearl8534 2018-12-30 09:47:45)

Re: Logo

thanks Derek....
its good... I tried this solution but did not made relataionship.. so i got an error.. thanks for your help

Re: Logo

hello derek...
I tried same procedure but did't found picture in report... picture  was blank... I created combobox in set index 1.. made receipt relation ship with datatable. but loading not complete....

Re: Logo

Hi Raheel,
Are you trying it on data that you'd added before you created the relationship?  If so, there wouldn't be any id's in place to link the data.
Can you attach what you've done and maybe I or someone else might spot something?
Derek.

21 (edited by blackpearl8534 2018-12-30 13:56:35)

Re: Logo

oh.. yes.. i was checking on old stored data..
now i made new delivery.. now its working ....
thanks

22 (edited by derek 2018-12-30 16:39:02)

Re: Logo

No problem.
I often find my problem is with the data rather than the program itself so I use SQLiteStudio (it's free) to look at how the data is being stored.
But if you don't have SQLiteStudio, it's very easy to create a temporary form and display the entire contents of all your tables on it (including any relationships that might be missing).
Have a look at the attached - I use a temporary form called 'raw data' and place a button (raw data) on the first form.  Click it and it shows you right away where there might be a problem (in this example, some links between the 'database' table and the 'receipt' table are missing).    Once you have corrected that and are happy that the data is being stored as you want, you can simply delete the form and button.
Derek.

Post's attachments

Attachment icon logo2a.zip 572.93 kb, 414 downloads since 2018-12-30 

23 (edited by blackpearl8534 2018-12-30 16:48:05)

Re: Logo

thanks  Derek...
You was right...
i was trying on old data entries...
i made new entry now its work...
i need your contact number.. if you dont mind