OpenXML: update Embedded excel in Word document - openxml

I am updating word template with data run time using OpenXML. My question is after entering cell values in embedded Excel, it is not reflecting when I open the word document after process.
e.g. I have one word template document which has total 6 embedded Excel object. Each embedded Excel has three worksheets (e.g. display, data & settings). Once I have data while running application, the code is filling the value in data worksheet. The Display worksheet shows the value from Data worksheet based on Formulas applied on cells on display worksheet. Once entire process completes I opened newly generated word document, it shows Excel Display worksheet without the values applied. If I will edit/open worksheet from Word document than it get refreshed and showing new values.
Is there way in OpenXML to fix this issue?

Related

Crystal Reports: how do i export a table to excel data and insert line breaks without getting everything on one horizontal line?

i'm new to CR. i have a report basically consisting of 2 tables of data(data comes from several subreports, not crosstab) and whenever i export to excel data it all comes out under 1 line, the entire report.
i've tried adding adding Chr(10)/Chr(13)/Chrw(10)/Chrw(13) at the beginning of each line, together with the data as well as a separated formula but only get an empty cell, instead of a new line.
if i separate the data in different sections, i'd lose the "table" look as i cannot extend lines&boxes over the section length.
i'm out of ideas at this point. anybody?
Option 1: get the data into a single data set. For example, use a Command/View/SP with a UNION ALL in the SQL.
Option 2: at least one of the 3rd-party Crystal Reports tools listed here allows you to automate the process of exporting one report to Excel and append the Excel export of a 2nd report to the same Excel workbook and worksheet.

Relative Date Item in Power Pivot GETPIVOT DATA excel function

I am using a GETPIVOTDATA function in Excel to source data from a pivot table generated by a Power BI query (everything was originally only in excel, the file got too large, so i stored the main tables in PBI but kept the reports in excel for mgmt's sake).
=GETPIVOTDATA("[Measures].["&$A$100&"]",'PIVOT Table_test'!$A$126,"[Master].[field1]","[Master].[field1].&["&C$26&"]","[Master].[AsofDate]","[Master].[AsofDate].&[2022-04-30T00:00:00]")
However, I want to make the GETPIVOTDATA function as dynamic as possible to prevent having too many hardcoded fields/items for each table that fields the charts we look at. However, when i reference the pivot table, the '[Asof]' field populates the static item as "...&[2022-04-30T00:00:00]")...
I have been trying to change that to reference a header row that contains a Short Date value (4/30/2022) like &["&$B&1"&"]")... but i keep getting #ref errors, every other field accepts the "&&" method, and when i leave the hardcoded timestamp in the formula, it populates.
So it has to be that reference but i do not understand what I am doing wrong. I have also tried changing the format of both the header row in Excel and the field within PBI but to no success.
Found the answer on another site. The solution in the item brackets is to write the following:
["&TEXT($A22,"yyyy-mm-dd""T00:00:00""")&"]

Copy data from Spreadsheet[LibreOffice Calc] to tables of Text Document[LibreOffice]

This was very interesting and challenging task for me. I want to copy data (1000s of rows with multiple columns) from Libre Office calc[spreadsheet] to the tables in Libre Office Writer[Text Document]. I spent almost a day to figure out the solution. Couldn't find the solution from any sites.
Copy the data[rows] from Spreadsheet.
Paste the same to the MS Word document[I did it by using Google docs as I'm using ubuntu].The table is created with rows and columns which is same as copied data.
Copy the table from word document and paste it in the Libre office Text Document.
Create the table with number of rows and columns Libre office Text Document.
Copy the table from Libre office Text Document[copied in point(3)] and paste in the table which is created in point(4).
NOTE / CAUTION : If you skip or alter any steps, it wont work.
Converting a column of text (perhaps from a screen-scrape of a online table) to a table format suitable for further work in a spreadsheet is easy if you have the traditional (locally installed) MS-Word program. The "Convert text to table" function there permits you to specify how many columns are in each record without having to edit your input files to manually place delimiters like commas, semi-colons, tabs etc. which is a PITA when you have to count rows to leave out the delimiter.
LibreOffice writer has a lightweight convert-text-to-table function which requires a lot of data conditioning before using it. In Libra Calc, Like any good spreadsheet, the "Transpose" function can be used to convert, say, 8 rows of the input column to a single 8-column row, but automating this requires macros or fixed templates.
So it is a non-trivial problem to duplicate that powerful capability in the old, locally installed MS-Word app, where users can take pages and pages of one-word data elements, and convert them into a "N" column table, where "N" is specified when you invoke the conversion in MS Word.

Issue with repeating static text in Detail band

I am using iReport to make a jrxml file. When I create a file and click on "Launch report wizard" it load some sql query from my database, configured with iReport.
I write some static data and also use some image to make a sample pdf file. I write some string in title field and also in column and detail1. Title section show once but value of column header and detail1 repeat many times. My repeated data is equals to the number of data in my table which I load at creation time. How can I stop to repeat my data?
whatever you write in your detail1 it will repeated until your query ends

How to create Excel document with proper cell alignment using Ireport?

I can able to create Excel document using Jasper Report but the problem is that fields are not properly aligned in the cells of excel sheet and all the data are populated in the plain surface without any cells.i.e) I cannot see any cells in the data populated area.Can u please give me suggestion to make proper Excel document with cell alignment.
I had this same struggle and came up with the following. At the time, I was using iReport (3.0.0) and was able to generate a good xls file. It may be easier in newer versions of iReport and/or JasperReports. Here's what I did:
I created a new report using the new report wizard and chose a tabular template. This creates a report with all of the fields in a line with no gaps between them. It is very key that fields are vertically aligned, that all the same height, and that there are no gaps between fields.
I removed all of the extra objects created (title, extra lines) except for the fields and the headers. I then collapsed all of the bands except the column header and detail bands.
On the report properties, I checked "Ignore pagination"
I changed the text color of the header fields, otherwise it ends up as white on white.
The rest of the important options can be found by selecting Options -> Export Options from the menu and then scrolling down to the "XLS Exporter" section. I attached a screen shot of the options I chose. You can experiment with the settings, but I found (through trial and error) that the options I ended up with work pretty well. These options are not stored in the report def file, they are attributes of the thing generating the report. iReport takes care of it when testing in that environment. We are using custom Java to generate the report in production and we set the attributes there.
XLS Exporter Dialog http://www.imagechicken.com/uploads/1270760205041768200.png