dynamically assign name to sheet

vijuagrawa
edited February 11, 2022 in Analytics #1
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

  • Jenkinsj5
    edited December 31, 1969 #2
    Can you use a dynamic label, with some JavaScript to define the label value?
    Warning No formatter is installed for the format ipb
  • ahsiang
    edited December 31, 1969 #3
    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>)
    Warning No formatter is installed for the format ipb
  • vijuagrawa
    edited December 31, 1969 #4
    I used above code,
    but no success,its still show "sheet1,sheet2"
  • Jenkinsj5
    edited December 31, 1969 #5
    <blockquote class='ipsBlockquote' data-author="'vijuagrawa'" data-cid="112911" data-time="1357202453" data-date="03 January 2013 - 01:40 AM"><p>
    I used above code,<br />
    but no success,its still show "sheet1,sheet2"<br /></p></blockquote>
    <br />
    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?
    Warning No formatter is installed for the format ipb
  • vijuagrawa
    edited December 31, 1969 #6
    Yes i am only trying to have the Excel tabs change from 'sheet1' to 'xyz
  • Jenkinsj5
    edited December 31, 1969 #7
    That solution is outside of my skill set. I would like to see the solution if there is one.
    Warning No formatter is installed for the format ipb
  • ahsiang
    edited December 31, 1969 #8
    Warning No formatter is installed for the format ipb
  • Yaytay
    edited December 31, 1969 #9
    <blockquote class='ipsBlockquote' data-author="'ahsiang'" data-cid="112923" data-time="1357224972" data-date="03 January 2013 - 07:56 AM"><p>
    Here's a sample.<br />
    <br />
    <a class='bbc_url' href='http://www.birt-exchange.org/org/devshare/designing-birt-reports/1451-naming-tabs-in-export-to-excel/'>http://www.birt-exchange.org/org/devshare/designing-birt-reports/1451-naming-tabs-in-export-to-excel/</a><br /></p></blockquote>
    Different emitters use different techniques for naming sheets (quoting from that link: "This is only for the commercial version of the Excel emitter.").<br />
    <br />
    Which emitter are you using?<br />
    For the SpudSoft emitters the sheet names come from the name of the table that caused the page break.<br />
    <br />
    Jim
  • vijuagrawa
    edited December 31, 1969 #10
    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
  • Yaytay
    edited December 31, 1969 #11
    <blockquote class='ipsBlockquote' data-author="'vijuagrawa'" data-cid="113000" data-time="1357535805" data-date="06 January 2013 - 10:16 PM"><p>
    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<br /></p></blockquote>
    <br />
    It really does depend on the emitter you use.<br />
    For the SpudSoft emitters sheets within a group can be set using the table of contents entry for the group.<br />
    <br />
    Jim
  • Jenkinsj5
    edited December 31, 1969 #12
    <blockquote class='ipsBlockquote' data-author="'Yaytay'" data-cid="113024" data-time="1357583579" data-date="07 January 2013 - 11:32 AM"><p>
    It really does depend on the emitter you use.<br />
    For the SpudSoft emitters sheets within a group can be set using the table of contents entry for the group.<br />
    <br />
    Jim<br /></p></blockquote>
    <br />
    What is an emitter and how do you know which one you are using?
    Warning No formatter is installed for the format ipb
  • Yaytay
    edited December 31, 1969 #13
    <blockquote class='ipsBlockquote' data-author="'Jenkinsj5'" data-cid="113026" data-time="1357583874" data-date="07 January 2013 - 11:37 AM"><p>
    What is an emitter and how do you know which one you are using?<br /></p></blockquote>
    Now that's a fair question :)<br />
    <br />
    Emitters are a type of BIRT plugin.<br />
    Emitters are responsible for taking the processed report structure and converting it to the output format you want.<br />
    So one emitter is responsible for generating Excel format files, another emitter is responsible for generating PDF files.<br />
    <br />
    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).<br />
    <br />
    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.<br />
    If you are working with an installation that someone else is in charge of it can be more difficult to tell.<br />
    <br />
    Jim
  • vijuagrawa
    edited December 31, 1969 #14
    I am using BIRT 4.2.1

    and uk.co.spudsoft.birt.emitters.excel_0.8.0.201211020842
  • Yaytay
    edited December 31, 1969 #15
    <blockquote class='ipsBlockquote' data-author="'vijuagrawa'" data-cid="113048" data-time="1357624781" data-date="07 January 2013 - 10:59 PM"><p>
    I am using BIRT 4.2.1<br />
    <br />
    and uk.co.spudsoft.birt.emitters.excel_0.8.0.201211020842<br /></p></blockquote>
    Well in that case I can help :)<br />
    <br />
    Are you able to post your report design?<br />
    You have a group within a table and you want the sheet names based on the group, yes?<br />
    I'll see if I can knock up an example for you.<br />
    <br />
    Jim
  • Yaytay
    edited December 31, 1969 #16
    <blockquote class='ipsBlockquote' data-author="'vijuagrawa'" data-cid="113048" data-time="1357624781" data-date="07 January 2013 - 10:59 PM"><p>
    I am using BIRT 4.2.1<br />
    <br />
    and uk.co.spudsoft.birt.emitters.excel_0.8.0.201211020842<br /></p></blockquote>
    Does this help?<br />
    <br />
    The report design has two levels of grouping, but only does page breaks on the higher level (country).<br />
    If you edit the group at that level you can see the following settings:<br />
    <br />
    Page break:<br />
    Before: Auto<br />
    After: Always Excluding Last<br />
    Inside: Avoid<br />
    <br />
    Table of Contents:<br />
    Item Expression: row["COUNTRY"]<br />
    <br />
    It is that table of contents expression that controls the sheet names.<br />
    <br />
    Jim
  • vijuagrawa
    edited December 31, 1969 #17
    thanks Jim,

    It worked.
  • rajessu
    edited December 31, 1969 #18
    <blockquote class='ipsBlockquote' data-author="'Yaytay'" data-cid="113050" data-time="1357627634" data-date="07 January 2013 - 11:47 PM"><p>
    Does this help?<br />
    <br />
    The report design has two levels of grouping, but only does page breaks on the higher level (country).<br />
    If you edit the group at that level you can see the following settings:<br />
    <br />
    Page break:<br />
    Before: Auto<br />
    After: Always Excluding Last<br />
    Inside: Avoid<br />
    <br />
    Table of Contents:<br />
    Item Expression: row["COUNTRY"]<br />
    <br />
    It is that table of contents expression that controls the sheet names.<br />
    <br />
    Jim<br /></p></blockquote>
  • rajessu
    edited December 31, 1969 #19
    <blockquote class='ipsBlockquote' data-author="'Yaytay'" data-cid="113050" data-time="1357627634" data-date="07 January 2013 - 11:47 PM"><p>
    Does this help?<br />
    <br />
    The report design has two levels of grouping, but only does page breaks on the higher level (country).<br />
    If you edit the group at that level you can see the following settings:<br />
    <br />
    Page break:<br />
    Before: Auto<br />
    After: Always Excluding Last<br />
    Inside: Avoid<br />
    <br />
    Table of Contents:<br />
    Item Expression: row["COUNTRY"]<br />
    <br />
    It is that table of contents expression that controls the sheet names.<br />
    <br />
    Jim<br /></p></blockquote>
    <br />
    <br />
    Hi Jim,<br />
    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?<br />
    <br />
    Thanks,<br />
    Rajesh S
  • Yaytay
    edited December 31, 1969 #20
    <blockquote class='ipsBlockquote' data-author="'rajessu'" data-cid="113684" data-time="1359451201" data-date="29 January 2013 - 02:20 AM"><p>
    Hi Jim,<br />
    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?<br />
    <br />
    Thanks,<br />
    Rajesh S<br /></p></blockquote>
    Can you post your XLS file?<br />
    Or can you say whether you get the warning about file type and extension from Excel when you open the file?<br />
    <br />
    My first suspicion is that you aren't using my emitter.<br />
    <br />
    Jim
  • <p>Hai all, can you tell me how to rename the excel sheet using birt.... </p>
  • <p>This is an old thread so you might want to start another one.</p>
    <p> </p>
    <p>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?</p>
    <p> </p>
    <p>There are also previous threads with a similar question if you haven't searched already:</p>
    <p><a data-ipb='nomediaparse' href='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/39032-multiple-tabs-in-a-excel-output-from-birt-report/</a></p&gt;
    <p> </p>
    <p><a data-ipb='nomediaparse' href='http://developer.actuate.com/community/forum/index.php?/topic/38005-naming-excel-tabs/'>http://developer.actuate.com/community/forum/index.php?/topic/38005-naming-excel-tabs/</a></p&gt;
    Warning No formatter is installed for the format ipb
  • @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.