Excel template translator JETT to append data to workbook based on template - jett

I am using JETT to generate xls from xls template. My input data will be given in pages is there way to append data to sheet as well applying template from input xls to output workbook using Jett api's

It is definitely possible.
You can write some script code at the beginning of your sheet (with ${{ /*your code here;*/ return '';}} . This code will get the data from the sheets using POI API and will store it in some variables. See how to access POI API from JETT Script here: http://jett.sourceforge.net/expressions/poi_objects.html ).
Once the data is stored into variables, you can insert them in sheets with standard JETT templating capabilities, by referring to the variables that you created in your script block.
Just make sure that the code block creating the variables with data lies before the place where the variables are used in your template.

Related

How to generate a text file in asp.net core (Razor) by using a static text template

I want to generate a file in ASP.Net Core using a pre-defined template. The template has several variables which has to be replaced by the values in the generated file. Template has "%" wildcard to identify the variable. For example, In the attached image, %SITECODE% should be replaced by the actual value.

How to download normal word export not grid layout export from Jasper soft v6.3.1

I am using Jasper soft 6.3.1 and Jasperserver 6.3.0.
I am generating a report book using Jasper.
When I export report book into .docx report, this word file contains grid. Its not like normal document.
How I can download docx like normal ms word document?
Is there any alternative?
Do I need to go for Aspose.com solution, if yes, then how ?
Jasper will always export an docx-output in a table/grid structure. Unfortunately there is no other way.
You can achieve your requirements using Aspose.Words for JasperReports. The output document will be according to the elements of your report. Please read the documentation of Aspose.Words for JasperReports. I work with Aspose as Developer evangelist.
Yes, you will need to use a 3rd party library to achieve this. Aspose.Words or any other similar library would do the trick but I strongly suggest that you first take a look at this library that allows you to create a template in MS Word, with all the necessary formatting and placehoders for the data. At runtime this template is filled with data. You can then choose the output format in .docx, .pdf or .xps format.
// Instancing report engine, by assigning the data source
DocumentGenerator dg = new DocumentGenerator(DataAccess.GetOrderById(7));
// Generating report by specifying the report template and the resulting report (as file paths)
dg.GenerateDocument("example.docx", "example_output.docx");

OfficeWriter data marker for sheet name

We only have the Template DLL v.8 installed, we use Microsoft SSIS v.2008R2 to process the data and then use a script task to bind the data to a template.
I have a need to produce a workbook with multiple sheets, the sheet names need to be dynamic.
Can you use a data marker on the sheet name?
Yes you can. You mention version 8, but you don't specify if it is 8.0 or you have a minor version of v8.
Either way this feature was introduced in v8.5.0 of ExcelWriter.
See the OfficeWriter Change log that states:
ExcelTemplate allows data markers in tab names of XLSX/XLSM files
For more specific documentation on using datamarkers in sheet tabs see SoftArtisan's documentation
Just realize the Excel Sheet names have limitations that Excel controls, such as max number of characters, so you by limited in the data marker names you can use. One way to get around that issue would be to use ordinal syntax.

Purpose for Word Open XML and content controls binding

For word report generation, I am looking at binding XML to content controls to see if it is any easier than to use Word Interop and hardcode index reference to content controls to assign values to them.
However, I don't really understand how to do it.
My work flow is entering information in Excel and then generate an XML file to have content controls populated by XML, however, what I read is the other way round: Word Control Control Toolkit and descriptions where the XML is populated by user entering information in Word, and then programmer to unzip docx file to retrieve the XML file.
How can I populate content controls with XML?
There are samples on generating Word documents from Word templates, XML and data bound content controls # http://worddocgenerator.codeplex.com/
Set up the mapped content controls in the 'template' docx using the content control toolkit or similar. Do this using a sample XML file containing your Excel data.
Now you have that template document, at run time you can inject your XML file into it (ie replace the custom xml part it contains, with your instance data), in C# or Java or whatever.
When the user opens the document in Word 2007/2010, the information in the custom XML part will automatically be copied into the bound controls, and visible to the user.
Note that content control data binding doesn't easily support repeating data (eg populating table rows) in Word 2007/2010, though there are ways to do it.

Exporting data in enhanced Grid to csv or xml format using dojo

In my project we are using dojo framework in UI. We are having a functionality to exporting the data in the enhanced grid into excel/csv files. In the dojo toolkit, they are binding the id in the textarea but i need those values in the excel/csv file...can any one help in this issue...? if possible pls tell me how to export the enhanced grid data to excel/csv files...
If you are already using the Enhanced Data Grid, you should be able to include the exporter plugin - dojox.grid.enhanced.plugins.exporter.CSVWriter - to get the CSV text.
This will give you access to two main functions exportGrid and exportSelected that will take the contents and export them as CSV text.
Unfortunately that doesn't get them as a separate file (click to download), just the formatted text in a textarea (or whatever).
To get a "click to download CSV function), you could write a servlet/jsp proxy, which would take a POST from your page with the CSV text (from the plugin above) as part of the form and simply copy it back out with the correct headers to make it appear as an attachment.
response.setContentType("text/csv"); response.setHeader("Content-Disposition","attatchment;filename=name.csv")
This would require something server side though.. and at that point, you may want to consider having a servlet simply produce the CSV text directly.
http://dojotoolkit.org/reference-guide/dojox/grid/EnhancedGrid/plugins/Exporter.html