Announcement

Collapse
No announcement yet.

Print two reports using one print button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Print two reports using one print button

    I have a unique situation where I have a complex pdf report with static fields/columns and a grid report with dynamic columns / rows. The first I created in the scriptcase pdf generator, the second I created using the user-defined grid. Currently to run these two reports the user has two buttons, one to run the pdf, the other to run the grid. Is there any way to combine this? Like a one button prints both option, or is there a way to add the grid report (which contains multiple grids multiple tables into one report) to automatically print with the pdf? I tried adding new fields but with the pdf everything is static and I need it to be dynamic. I tried recreating the complex report in html and adding it to the user defined grid but that looked awful and didn't fit to the page settings. The pdf version is much cleaner.
    Any ideas?

  • #2
    to create dynamic reports, a view showing all your fields would be ideal, create a search in pdf from this view (you create the pdf on the table, but you look for your results in your view), then you create conditions in your pdf that will work based on your search fields, tcpdf is excellent for all this, it works very well for me, obviously it is not always easy, but quite possible,
    good luck

    Comment


    • #3
      good morning
      I also have the same problem or at least very similar
      I have to print a page with customer data and a second print with a series of pages based on the records that the customer inserts.
      It is not an invoice since the records are of three different archives.
      The first archive must be printed as a page and the rest with a record and its sub-records
      I have prints on two pdf reports but if I create a button with
      calls (sc_redir) to the two prints only print the first one
      So I made two buttons, very bad
      If you have suggestions
      Thank you

      Comment


      • #4
        put the code of the 2 buttons in one button.

        Comment


        • #5
          Ok I do so, but is very terrible and the user don't understand becaiuse there is two buttons insted one such as other applications
          Thank's
          Mimmo

          Comment


          • #6
            after putting the code of the two buttons into a thrid one, you must hide these using css. So in that case users only see the 3rd button

            Comment


            • #7
              Hallo nsch2308
              Your remark seems to answer my question. However I do not follow your explanation completely.
              I need to create a grid with dynamic number of columns. Some more explanations would be helpful. Thanks!
              From the Swiss Mountains

              Comment


              • #8
                hello, to put it simply, you create a loop in event: on record,
                in your pdf layer you create the same loop, but there you use a multicell that will have the value $ x of your loop in record,
                a formula which will have to specify if your multicell must go to the line or accept the following multicell by side, and your grids will be drawn by themselves,

                Comment


                • #9
                  @nsch2308
                  maybe an code example?

                  Comment


                  • #10
                    hello,
                    in order to follow the progress, you have to make a loop or a foreach on a table where the values ​​are,
                    on record prepare them in a loop, because in the pdf layout, we will use a loop, not a foreach, we recover the value of the variable of on record and one pdf layout code defines it in a multicell,
                    attention which one defines in three times, the boxes of title and title of columns, ensues the cells or multicell that draw and display at the same time the values, and then the base of the painting.
                    in each step it is necessary to define the last multicell which will return to the line, in this case three loops for a title, a value, and an end of table, I will try to show a loop in the part layout, but it is clean to each according to all that it needs, it is simply worth retinir, that with the pdf disponnible in scriptcase, we use the record for the lookup of our values ​​whatever they are, and in the layout of pdf we define them with tcpdf, hard to do more because it is the result of several years of practice tcpdf,
                    I remain disponnible for the little that I learned

                    Comment


                    • #11
                      Originally posted by nonkelmike View Post
                      after putting the code of the two buttons into a thrid one, you must hide these using css. So in that case users only see the 3rd button
                      Hi
                      thanks to the suggestion of the two buttons. I can not understand how you do from the third button to execute the code of the other two
                      Thanks
                      Mimmo

                      Comment

                      Working...
                      X