Hitachi Vantara Pentaho Community Forums
Results 1 to 15 of 15

Thread: how to dynamic change the element's height

  1. #1
    Join Date
    Jun 2009
    Posts
    116

    Default how to dynamic change the element's height

    Hello everyone,
    I have use the pentaho report designer 3.0.0 , and the pentaho-reporting-engine-classic-0.8.9.11 , now I am using the pentaho report designer to design the report , and then publish it to local computer to generate the xml file , at last import the xml file in my program .


    Now I have a difficult problem . And I can’t make it .

    The require is that: the first column is continent , the second column is country , the third column is city .

    The data is immensity , So I must input the data in the itemband , so I also need to add the frame to the element , for example :


    Asia china BeiJing
    ShangHai
    GongZhou
    Hongkong

    Japan Tokyo
    Ōsaka
    Hiroshima

    Korea Seoul

    America American Washington
    New York
    Detroit
    Houston

    Canada Ottawa
    Toronto

    What can I do if I want to accomplish this in the itemband , I can accomplish this by subband ,but there is still a problem , every size of same column must to be same size , So the size of china and the size of Korea is the same , but they have the different numbers cities , this is just a example , it there is one country have 100 cities , and another one country only have one city ,but their size is the same , this is unacceptable to the customer .

    So here is my question , is there some method to dynamic change the size , especially the height of the element , I am really hope learn the some of advise from someone .



  2. #2
    Join Date
    Jun 2009
    Posts
    116

    Default



    Asia china BeiJing
    ShangHai
    GongZhou
    Hongkong

    Japan Tokyo
    Ōsaka
    Hiroshima

    Korea Seoul

    America American Washington
    New York
    Detroit
    Houston

    Canada Ottawa
    Toronto

  3. #3
    Join Date
    Jun 2009
    Posts
    116

    Default

    I am sorry I can't arrany the data of my example , but i think it is easy to unstand .

          

  4. #4
    Join Date
    Mar 2009
    Posts
    30

    Default Can you create an example in XLS form?

    I'm not sure I fully understand your requirement, but I think you want a grouping by continent & country, where each country has several cities and you don't want to repeat the continent & country values. See the attached XLS, is that what you mean?

    Attached Files Attached Files

  5. #5
    Join Date
    Jun 2009
    Posts
    116

    Default

    I am sorry yesterday is very busy , and I have not arrange it very well .

    And what you describe is very rihgt , that is what i want to accomplish ,
    and I also have another require :

    1 I want the continent is in a big table , which height is equal to the sum of height of the city table which is belong to the contenent , and the country is also in the big table ,which height is equal to the sum of height of the city which is belong to the country .

    2 I want to add the frame to every every table .

    3 I want the content of the table is placed in the middlecenter.

    it is describe in the xls file :

    I want to use subband in the itemband to accomplish this require , but there is a problem that the country belong to the continent and the city belong to the country are not static , it will often change by the require ,
    and if i design with subband the structrue is static , it is cleanly no satisfy the require . Is there some methods to accomplish this structrue , is there some one who can help me , please give me the advise ,I am really grateful for you , thanks very much.
    Attached Files Attached Files

  6. #6
    Join Date
    Jun 2009
    Posts
    116

    Default

    I am sorry you said that I can group by continent and country , but it is useless , if I want the group to be successful , I must to add them to the group header and group footer , but I don’t need to do this , I think this require is very prevalent , and there is must some methods to accomplish this require , may be just I haven’t find out the ways . Is there some one who can help me ? I am puzzled by the problem for several weeks , please help me and give me some advise , thanks very much .

  7. #7
    Join Date
    Mar 2009
    Posts
    30

    Default

    Yes, it's totally clear to me what you want, and if you were using Business Objects this would be a piece of cake (two breaks, remove headers and center values accross break). But this is PRD and I'm not sure if there's an easy way to do this. I'll have a look since it is a nice challenge!

  8. #8
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Hmm ... what's the problem? Add the ItemHideFunction to get rid of the repeating values.

    Add a group that has continent and country as its fields. To make the borders work, add a horizontal line to the group-header and group footer. And last but not least, add vertical lines or borders to the columns.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  9. #9
    Join Date
    Mar 2009
    Posts
    30

    Default

    Ok, that's something like this then, very quick and dirty. And thanks for the hints, couldn't have done it without them ;-) Final challenge is the vertical positioning of the group values so that they are displayed in the middle instead of at the top of the group.
    Attached Files Attached Files

  10. #10
    Join Date
    Jun 2009
    Posts
    116

    Default

    Thanks you very much , I have try you method , it works well.

    But I still have several question:

    1 The first question is :
    I open the ContinentCountryGroup.prpt with pentaho report designer 3.5.0 RC2, it work well , but I find that you use the function of Hide repeating , so the continent data is on the top , but I need to it to be show in the middle , is it impossible?

    2 The second question is :
    I have use pentaho report designer 3.5.0 RC2 , but I find there is some of the big problem that , the pentaho report designer 3.5.0 RC2 can't publish to the local computer to generate the xml file , I don't know is it don't support generate the xml file , or I can't find out the methods . If the pentaho report designer 3.5.0 RC2 can't accomplish this function , is it will never support generate the xml file henceforward ? What can I do if i want the report designer to generate the xml file ?If it can generate the xml file successfully, how can I do it ?

    3 The third question is :
    Now I am use the pentaho report designer 3.0.0 , it can generate the xml file easily , but I can find out the function of Hide repeating which you use in the ContinentCountryGroup.prpt , does the report designer 3.0.0 have
    no support to this function . If the report designer 3.5.0 can't generate the xml file , I have to use the report designer 3.0.0 , but if the report designer 3.0.0 don't support this function , my god , what can i do ?

    Thanks for you useful advise , but I still have above problems , I still hope there is someone come to help me .

  11. #11
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    (1) Only with crude hacks. The real solution would be to use a crosstab for this, but crosstabs wont be readily available until the Sugar release comes out.

    (2) XML is dead. Use the PRPT files. The reporting engine understands them, and you can let it parse them in the same way you parse the XML files. If you want to modify the report-definition afterwards, use the API.

    (3) Its definitely there, as the report-design-wizard also uses it. Its called "ItemHideFunction" I would bet.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  12. #12
    Join Date
    Mar 2009
    Posts
    30

    Default

    I don't think you can center the group value but maybe I'm wrong here. Otherwise, you should post a request for this feature in Jira. As for the XML output: why do you want/need this? With the Citrus release (3.5) you can just publish the .prpt to the server and you'll be fine.

  13. #13
    Join Date
    Jun 2009
    Posts
    116

    Talking

    Yes , I want to use the xml , there is three reason:

    1 The first one is that :
    our company is use the JFreeReport to generate the report by reading the xml file , and the xml is be writen by ourself .We use the pentaho product is just because pentaho has released the pentaho report designer which is base on JFreeReport , So we just want to use the the pentaho report designer to generate the xml file ,it will shorten the circle and lighten the workload .

    2 The second one is that:
    the xml file is easy to be read , it is convenient to be open by NoteBook or UltraEdit , I can see the content and easy to be modify . As you known , the pentaho report designer is not support dynamic column report and crosstab report so far , but out customer require need to accomplish these function , So I can design the static part of the report designer and generate to the xml file , then I can modify the xml file according to our need , I just use this methods to accomplish the dynamic column report . But the prpt file can't be open by NoteBook or UltraEdit , I don't the content , so I can't modify them.

    3 The third one is that:
    I know that the JFreeReport can read prpt file and modify the report by api, but I just can't find the example in pentaho-reporting-engine-classic-0.8.9.11 , I can't find how to read the prpt file in the api , and I can't find how to modify the report by api , our report is complex , we need subreport , sumfunction , averagefunction , bias , frame and many other particular require , So I think it will cost a lot of time to accomplish these requires by api .

    At last , I have try to use the function of "ItemHideFunction" , it works very well . Thanks very much . Your advise is very useful for me . And it will be perfect if it can be center . Thanks for everyone who help me I will awlays support the pentaho report designer , and I still hope you can support to generate the xml , at least it is more easier for user to modify xml file .If it does not to support the xml file , I have to learn to how to read the prpt file and modify report in the api , but the code in the pentaho-reporting-engine-classic-0.8.9.11 is plenty , and is out-of-order , it is hard for me to study the api and it will cost much more time .


  14. #14
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    0.8.9 cannot read PRPT files, as this feature has been introduced in 0.8.11 (which is also called Citrus, and also ships as version 3.5).

    So if you stick with a 0.8.9-engine, then you also have to stay with Pentaho-Report-Designer 3.0. Any of the newer features cannot be used by you then.

    For parsing PRPT files:
    The PRPT files are parsed in exactly the same way you used the .xml files. Just change the filename. Thats it. No magic involved.

    There are API demos available in the demo-package. There are not many of them, but the purpose of these demos is not to show every conceivable feature, but to get you started. Along with the sources of the reporting-engine (or the javadoc generated from the sources), you should be able to define your own reports in no time.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  15. #15
    Join Date
    Jun 2009
    Posts
    116

    Default

    thanks for you advise . I will try 0.8.11-engine and pentaho report designer 3.5.0 RC2 , you advise is very helpful for me , Thanks very much .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.