7 Replies Latest reply: Sep 30, 2011 10:18 AM by 524753 RSS

    PDF and Excel output cell spacing issues

    user8840662
      Hi all..
      I have a report and template whose output should be both in PDF and Excel.

      Lets say I have two tables in out put one below other. (Table1 and table 2 below it..)

      Table 1 has 5 columns and table 2 has 30 columns.
      In PDF since it is difficult and ugly to show 30 columns, I made font as 6( very small font)

      PDF output looks fine. But, when I open the reort in excel..its all messed up and ugly.
      Table 1 column widths are very much uneven. lI noticed that table1, table 2 coulmns width are same...
      For my Requirement, they must have seperate widths.. Also..when I open the report in Excel, I still get in font size 6 which is ugly

      I want table1 column width and table 2 column width in Excel as seperate..

      How do I achieve this.
        • 1. Re: PDF and Excel output cell spacing issues
          524753
          In the RTF template
          add this as the first statement
           <?param@begin:_xf;''?> 
          then in the rtf template , you can add a conditional section for different output format.
          <?if:$_xf='pdf'?>
          
          <?end if?>
          or
          <?if:$_xf='excel'?>
          
          <?end if?>
          Add the font size programmatic, rather than using word font size
          • 2. Re: PDF and Excel output cell spacing issues
            user8840662
            vetsrini,

            Thanks for the reply.
            but, how do we add font programatically...I always add the font in Microsoft word.

            Also, the code which says $_xf = 'pdf' or 'excel',
            does that mean, two sets of tables(Table1, table2) whould be built in RTF? One set for PDF output and the Other set of these tables for Excel output?
            • 3. Re: PDF and Excel output cell spacing issues
              524753
              you can do that too..
              two set of tables, one for each output. and use the Microsoft word font properties.

              else
              add something like this
              <fo:block font-size="14pt" font-family="verdana" color="red">
              Your test or your field
                </fo:block>
              • 4. Re: PDF and Excel output cell spacing issues
                bifacts
                user,
                In this case what I would do is use 2 templates, one for pdf and one for excel. This is what I have done in one of the requirement.....
                The table 1 column widths get applied to table 2 column widths when you export to excel. This is the reason I had 2 templates in place.

                -bifacts
                http://www.obinotes.com
                • 5. Re: PDF and Excel output cell spacing issues
                  user8840662
                  Vetsrini wrote:
                  you can do that too..
                  two set of tables, one for each output. and use the Microsoft word font properties.

                  else
                  add something like this
                  <fo:block font-size="14pt" font-family="verdana" color="red">
                  Your test or your field
                  </fo:block>
                  Srini, this worked!


                  My font differences in Pdf and Excel has been eliminated now.
                  But however I have one more problem as I stated in my first post.
                  When I exported into Excel, My column width of first table is dependant on the other making my report look uneven.


                  I am providing the screen shots.


                  Look how Rate column of first table is very huge as it took the colmun width of table2 (Decription column)

                  http://i.imgur.com/Rj8CC.jpg

                  I need something like this: http://i.imgur.com/nklEN.jpg
                  Is this achievable?
                  • 6. Re: PDF and Excel output cell spacing issues
                    user8840662
                    bifacts wrote:
                    user,
                    In this case what I would do is use 2 templates, one for pdf and one for excel. This is what I have done in one of the requirement.....
                    The table 1 column widths get applied to table 2 column widths when you export to excel. This is the reason I had 2 templates in place.

                    -bifacts
                    http://www.obinotes.com
                    Even If I have a seperate emplate for Excel, the column width of Table 2 is getting applied to table 1
                    Is there any way we can make the widths of columns in two tables Independant.
                    Please take a look at the screen shot Images provided in my previous post. Is that doable?
                    • 7. Re: PDF and Excel output cell spacing issues
                      524753
                      excel, respects the cell spacing for the entire column, cannot be shrunken for each table u have.