dynamically assign name to sheet

Hi all,

I have a table, withih a table i have used group over column say "A",
Column "A" have value 'xyz','abc','pqr'.

Now i have used pagebreak on group.

Now i want to create a sheet per value with name 'xyz','abc','pqr'.

I am getting 3 sheet as i wanted,but how to assign name to this sheet dynamically,let say i want to assign name Sheet-xyz,sheet-abc

Comments

  • edited December 31, 1969
    Can you use a dynamic label, with some JavaScript to define the label value?
    Silence Bestows Consent
  • edited December 31, 1969
    Choose the table, then select script onPageBreak, add in something like this

    reportContext.setPageVariable(reportContext.PAGE_VAR_PAGE_LABEL,<Replace here with what you want>)
    Regards
    Woo WS
  • edited December 31, 1969
    I used above code,
    but no success,its still show "sheet1,sheet2"
  • edited December 31, 1969


    I used above code,

    but no success,its still show "sheet1,sheet2"




    Just to clarify: you are trying to have the Excel tabs change from 'sheet1' to 'xyz'; not apply a label to the top of the report?
    Silence Bestows Consent
  • edited December 31, 1969
    Yes i am only trying to have the Excel tabs change from 'sheet1' to 'xyz
  • edited December 31, 1969
    That solution is outside of my skill set. I would like to see the solution if there is one.
    Silence Bestows Consent
  • edited December 31, 1969


    Here's a sample.



    http://www.birt-exchange.org/org/devshare/designing-birt-reports/1451-naming-tabs-in-export-to-excel/


    Different emitters use different techniques for naming sheets (quoting from that link: "This is only for the commercial version of the Excel emitter.").



    Which emitter are you using?

    For the SpudSoft emitters the sheet names come from the name of the table that caused the page break.



    Jim
  • edited December 31, 1969
    Actually the thing is that i have Group in a table, and pagebreak happen on the basic of group,and i want to rename sheet base on group ,I try adding your code in pagebreak of group but no success
  • edited December 31, 1969


    Actually the thing is that i have Group in a table, and pagebreak happen on the basic of group,and i want to rename sheet base on group ,I try adding your code in pagebreak of group but no success




    It really does depend on the emitter you use.

    For the SpudSoft emitters sheets within a group can be set using the table of contents entry for the group.



    Jim
  • edited December 31, 1969


    It really does depend on the emitter you use.

    For the SpudSoft emitters sheets within a group can be set using the table of contents entry for the group.



    Jim




    What is an emitter and how do you know which one you are using?
    Silence Bestows Consent
  • edited December 31, 1969


    What is an emitter and how do you know which one you are using?


    Now that's a fair question :)



    Emitters are a type of BIRT plugin.

    Emitters are responsible for taking the processed report structure and converting it to the output format you want.

    So one emitter is responsible for generating Excel format files, another emitter is responsible for generating PDF files.



    The built-in Excel emitter in Open Source BIRT leaves a lot to be desired, so there are quite a few alternatives (in fact, if you google "BIRT emitters" the first page is entirely replacement Excel emitters - some free, some not, and some repeated).



    If you haven't installed a custom Excel emitter, and noone else has either, then telling us which version of BIRT (including whether it's open source BIRT or an Actuate product) you are using should suffice.

    If you are working with an installation that someone else is in charge of it can be more difficult to tell.



    Jim
  • edited December 31, 1969
    I am using BIRT 4.2.1

    and uk.co.spudsoft.birt.emitters.excel_0.8.0.201211020842
  • edited December 31, 1969


    I am using BIRT 4.2.1



    and uk.co.spudsoft.birt.emitters.excel_0.8.0.201211020842


    Well in that case I can help :)



    Are you able to post your report design?

    You have a group within a table and you want the sheet names based on the group, yes?

    I'll see if I can knock up an example for you.



    Jim
  • edited December 31, 1969


    I am using BIRT 4.2.1



    and uk.co.spudsoft.birt.emitters.excel_0.8.0.201211020842


    Does this help?



    The report design has two levels of grouping, but only does page breaks on the higher level (country).

    If you edit the group at that level you can see the following settings:



    Page break:

    Before: Auto

    After: Always Excluding Last

    Inside: Avoid



    Table of Contents:

    Item Expression: row["COUNTRY"]



    It is that table of contents expression that controls the sheet names.



    Jim
  • edited December 31, 1969
    thanks Jim,

    It worked.
  • edited December 31, 1969


    Does this help?



    The report design has two levels of grouping, but only does page breaks on the higher level (country).

    If you edit the group at that level you can see the following settings:



    Page break:

    Before: Auto

    After: Always Excluding Last

    Inside: Avoid



    Table of Contents:

    Item Expression: row["COUNTRY"]



    It is that table of contents expression that controls the sheet names.



    Jim

  • edited December 31, 1969


    Does this help?



    The report design has two levels of grouping, but only does page breaks on the higher level (country).

    If you edit the group at that level you can see the following settings:



    Page break:

    Before: Auto

    After: Always Excluding Last

    Inside: Avoid



    Table of Contents:

    Item Expression: row["COUNTRY"]



    It is that table of contents expression that controls the sheet names.



    Jim






    Hi Jim,

    I too used BIRT 4.2.1, and "uk.co.spudsoft.birt.emitters.excel_0.8.0.201211020842" emitter file and tried running your "rptdesign" file with the same parameters as in your post, yet it is creating only a single sheet for me, i am unable to see multiple sheets as in your attachment. Can you please let me know if it is the correct emitter file or am i missing something?



    Thanks,

    Rajesh S
  • edited December 31, 1969


    Hi Jim,

    I too used BIRT 4.2.1, and "uk.co.spudsoft.birt.emitters.excel_0.8.0.201211020842" emitter file and tried running your "rptdesign" file with the same parameters as in your post, yet it is creating only a single sheet for me, i am unable to see multiple sheets as in your attachment. Can you please let me know if it is the correct emitter file or am i missing something?



    Thanks,

    Rajesh S


    Can you post your XLS file?

    Or can you say whether you get the warning about file type and extension from Excel when you open the file?



    My first suspicion is that you aren't using my emitter.



    Jim
  • Hai all, can you tell me how to rename the excel sheet using birt.... 


  • This is an old thread so you might want to start another one.


     


    You'll need to let us know what version of BIRT you are using?  Also, open source BIRT, or commercial BIRT?  What Excel emitter are you using?


     


    There are also previous threads with a similar question if you haven't searched already:


    http://developer.actuate.com/community/forum/index.php?/topic/39032-multiple-tabs-in-a-excel-output-from-birt-report/


     


    http://developer.actuate.com/community/forum/index.php?/topic/38005-naming-excel-tabs/


    Clement Wong
    Principal Analytics Architect

    OpenText Corporation
    http://www.actuate.com | http://www.opentext.com

  • @ahsiang said:
    Choose the table, then select script onPageBreak, add in something like this

    reportContext.setPageVariable(reportContext.PAGE_VAR_PAGE_LABEL,)

    Thank you!!! Works Properly for me.

Sign In or Register to comment.