How to export dataset elements from Birt to .docx as numbered list - report

I have a birt report which contains numbered list of questions. It built with some dataset elements + label (text).
But after exporting it to .docx numbers usually merge with the text (as a part of text). I need it to be splitted out of the text (as the formatted numbered list in MS Word).
What can I do?
I expect of splitted numberes and question text

As I said in my comment, I doubt this is possible.
If you can live with a different structure that more or less has the same properties regarding visual appearance and editability (does that word exist?), what I do is:
Use something like a RUNNINGCOUNT aggregate to generate the item numbers.
Use a two-column table to render the ordered list: Left column contains the number, right column contains the text.
This takes care of the visual appearance.
To insert items inbetween manually later, one can insert a row into the table, but it's necessary to re-number the following items manually.

Related

separating multiple columns into more columns

The text from a pdf I scraped is jumbled up in different elements. Not to mention, it deleted data when it was converted to a data frame. It's really hard to tell where the text should have been split since it seems like I got it correct in the below code. How do I split the text so that it looks looks like the original table?
mintz = "https://www.mintz.com/sites/default/files/media/documents/2019-02-08/State%20Legislation%20on%20Biosimilars.pdf"
mintzText = pdf_subset(mintz,pages = 2:23)
mintzText = pdf_text(mintzText)
q = data.frame(trimws(mintzText))
mintzdf <- q %>%
rename(x = trimws.mintzText.) %>%
mutate(x=strsplit(x, "\\n")) %>%
unnest(x)
View(mintzdf)
mintzDF=mintzdf[-c(1:2),]
mintzDF=mintzDF %>%
separate(x, c("a","State", "Substitution
Requirements","Pharmacy Notification Requirements
(to prescriber, patient, or others)","Recordkeeping
Requirements"))%>%
select(-a)
View(mintzdf)
what it looks like
what it should look like
Pdf stored order for a page may be random or bottom rows upwards as there are no key press order rules for when lasers charge a drum (The design requirement for PDF introduction)
We are lucky if the order can be sensibly extracted, but this is a very well ordered PDF. So remember there is no need to observe the grid simply output by rows with spaces that with luck form columns.
In this case using poppler pdftotext with no controls a single page text order could look like this with the first column headed State and the second starting with Substitution\nRequirements\n so clearly there may be head scratching why State is not spaced away from Alaska? but then it is PDF after all, so expect there are no rules.
Looks like it was written down one column then across two then perhaps down the last ?.
Dependant on the very different page variations, I would attempt to target as vertical strips, rather than horizontals. so set a template as 4 vertical page high zones and then hope the horizontal breaks can be determined as matches. The alternative (probably better) is extract as a tabular layout and xpdf pdftotext may then give a better result.
Or use a python table extractor like pdfminer.

Read AGS type file in R

I am trying to read a special type of file (the format is called AGS) which looks like in the image:
This is basically a TEXT file, which contains many tables with different dimensions inside, separated by 2 (but sometimes more) empty rows. As you might guess, the problem is related to the fact that these tables have different number of columns and obviously different column names.
The first row in each table (here tables are denoted as GROUP) shows the name of the table, e.g. LOCA, HDPH, etc. The second row shows the column names. The third row shows the units of each column. All the other rows show the observations. In each row, columns are separated by commas and values are inside double quotes.
I am struggling to read this type of file. The ideal output would be to have each of these tables into separated data frames. Any help and ideas are much appreciated.
An example file can be downloaded here: example AGS file

R Dataframe - add a newline or whitespace bewtween two strings

I have a data frame containing two columns, let's call them "description" and "closure_notes". Basically what I am trying to do is combine the contents of both of those columns into a single one (replacing the contents of "description" with the merged contents of the two). The trick is, I need there to a blank line or two between the two pieces of data.
For instances, if df$description is, "A short descriptions of the issue", and df$closure_notes is, "Solved (Workaround): Fixed issue by restarting services", then the result I want as the new value for df$description should be:
A short description of the issue
Solved (Workaround): Fixed issue by restarting services
The reason for the space is for readability. This data will be eventually shown in a shiny app and an accompanying PDF report that can be generated vi knitr/rmarkdown. I want the space in there so when someone reads this they can easily jump right to the closure notes if they want to, but they want them combined into a single column. I have tried paste with several "\n\n" as a separator, tried using writeLines and cat, which work great, printing to the screen, but I want something that will write the result back to the data frame. I am looping through each row combining these two columns, I just need that blank line separating the two pieces of data. Any suggestions? Thanks in advance!
Shiny deals with HTML tags. Therefore try using < /br> and not \n\n

How to make RDLC report two column

I have a simple report which is supposed to be used for printing stickers. The sticker paper is A4 size and it has two columns. I successfully managed to print data to left column. I also want to print data to right column too. My current report looks like this :
[Title]
[NameLastName]
[Address]
How can I make my report to fill data to two columns? Thanks.
EDIT :
I have generated another column as suggested in other questions. But the result is still one column, Can anyone tell me the next step?
The simplest way to do it [I think] is to:
add additional "columnNumber" column and make it "1" for, say, all odd rows and "2" for all even rows.
then place two tables side by side and make the same DataSetName property for both of them
then filter the data in each table based on the columnNumber Value (add Filter to Filters property of the table)

Excel - I get an error when I try to add a column

We get an excel worksheet from a customer and there is a data discrepancy with one of the col. the item description they send. We want to programmatically open the document lookup the table using item column, and then write a new column with the item description from the table (on SQLSever) that part of getting the data is fine but how to create such a new column is where I am stumped. writing in asp.net but open to however it can be done
I am getting this error when trying to insert a column:
To prevent possible loss of data, Excel cannot shift nonblank cells
off of the worksheet. Select another location in which to insert new
cells, or delete data from the end of your worksheet.
If you do not have data in cells that can be shifted off of the
worksheet, you can reset which cells Excel considers nonblank. To do
this, press CTRL+End to locate the last nonblank cell on the
worksheet. Delete this cell and all cells between it and the last row
and column of your data then save.
This problem is not linked to your code, it happens when you have data on the last column (and so Excel do not want you to loose it).
Yet, the trick is Excel considers that any style is the same as data. So, if you have ever defined a style on the whole row, inserting a column may cause this error.
Let me give an example to explain it more:
Create a new Excel workbook
Select the whole first row
Paint it in Yellow (or whatever color)
Select cells from A1 to E1
Paint them in white
Try to insert a new column before B
You get the error because Excel does consider that you wanted to define a specific style to the last cell so you would loose this information if you inserted a new column
Have a look at your file to solve this issue (IMHO, defining style on a whole row is a bad practice because it could cause this kind of error).
Yeah I often get this annoying bug bothering me.
To avoid this behavior in Excel 2007, what you do is you go to the end of your data with CTRL+end.
Then you go one cell down (or one cell right if you are at the bottom), and copy this cell ( CTRL+c), that should be blank, since your outside your data.
Then go back to the place where you (not that stupid Excel) consider your data should stop, while holding the shift key, and paste it (CTRL+v).
After this you should be able to insert that column.

Resources