rlfisherpbtgroup.com Posted March 17, 2010 Share Posted March 17, 2010 Hello -I have not been successful searching this site for an answer, and I just purchased doc before 3.7.1 was released!I have used print-when in many cases. Now I understand that with 3.7 there is a "print when" capability matching on output type (exporter) but I can not find any doc for using that (print this way if html, print that way if XLS, etc.)Thanks to the community for any help with this. Link to comment Share on other sites More sharing options...
rlfisherpbtgroup.com Posted March 23, 2010 Author Share Posted March 23, 2010 I cannot find this in the doc that I have or on searching. I understand that in 3.7 there is a way to express "output type" in a print-when. So, for example, I could render an element one way for Excel export, and another way for every other type of export. Can't somebody please help me with this? Link to comment Share on other sites More sharing options...
dhavalmcaster Posted April 26, 2011 Share Posted April 26, 2011 Hi, Did you find any solution for how to know the export type of report runtime? Link to comment Share on other sites More sharing options...
jpauze Posted April 26, 2011 Share Posted April 26, 2011 I have searched high and low as well and while there is property which allows you to conditionaly print bands based on the export type (there is a recent post on that) there doesn't appear to be a property which tells you what the output type is and sometimes suppressing at the band level just doesn't suit your needs. In my case we have embedded JasperReports into our web application and the user can select the output format (and switch between them) in some cases such as hyperlinks to application functionality I only want to include the hyperlink if the output type is HTML but not when PDF or Word as these are files that can be distributed and hyperlinks won't work. To get around this problem, when we embedded jasperReports we determine what the output type is based on user selection and then we automatically set a report parameter called outputType (string) which then can be used for whatever we want and it automatically gets set for every report.Now on my hyperlink or any expression for that matter I can use the outputType to control what I like $P{outputType}.equals("PDF") ? "Do something for PDF" : "Do something when not PDF"Not sure if this helps your situation but works well for me.J Link to comment Share on other sites More sharing options...
rlfisherpbtgroup.com Posted April 26, 2011 Author Share Posted April 26, 2011 Thank you for your reply. Actually, we did do something very similar for quite awhile. Eventually, though, the requirements for html/pdf/xls reports diverged sufficiently that we generally have three different jrxml's now for each report, usually sharing the same query and other resources. Link to comment Share on other sites More sharing options...
mdahlman Posted April 26, 2011 Share Posted April 26, 2011 I'm not sure whether it meets folks' exact needs , but this is the property that people may have been thinking of:net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name}It's described in the Configuration Reference, and there's better info in the FAQ. It allows you to hide a band for a particular exporter. For example, hide page footers in html.Regards,Matt Link to comment Share on other sites More sharing options...
jpauze Posted April 26, 2011 Share Posted April 26, 2011 Thanks Matt, that one works perfectly if you are looking to exclude the entire band. I have found situations (for my implementation) where I wanted to determine output in a text element specifically within hyperlink expressions based on the output type and therefore it didn't suit perfectly, could have gotten around it by having multiple bands and switch between them based on the exclude.origin property but that is a bunch of extra work and I am lazy Link to comment Share on other sites More sharing options...
ktalarico Posted July 13, 2016 Share Posted July 13, 2016 I think you want net.sf.jasperreports.export.{format}.exclude.key.{suffix}See http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.{format}.exclude.key.{suffix} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now