AutoFit to content in Bi publisher - bi-publisher

is it possible to Auto Fit to the Content in Bi publisher
I have like max 30 Column and max of 30 Character length
I want the Cells to be Auto_Fit
Can this be done using on-line Layout Report Design or using RTF(Word Template)
Note:Excel template is not an option as HTML Preview is required and Excel Template Doesn't Support UI i.e. HTML preview of data in the report.please help me .gratitude.

If you are using Word to make an RTF template, you can specify a tables column width. The additional text would just wrap down.
Alternately you can do a sub-string of the first 30 characters of a field.
<?xdofx:substr(ELEMENT_NAME,START_POSITION,LENGTH)?>
<?xdofx:substr(ELEMENT_NAME,1,30)?>

Related

How to get leading zeros displayed in the Vaadin DateTimePicker component?

In my Vaadin Flow application, I'm using the Vaadin DateTimePicker component. If I select a date, it will be displayed without the leading zeros (e.g. "4.7.2021"). I would like the component to display the leading zeros (e.g. "04.07.2021"), but I could not find an API call to do so. Locale is Switzerland. Any ideas? I guess I'm missing a really easy solution to this all-day-problem…
You should use the EnhancedDatePicker https://vaadin.com/directory/component/enhanced-datepicker
There you can set pattern and even parsers. For example:
// how the date should be formatted
datePicker.setPattern("dd.MM.yyyy);
// allowed formats to enter the date
datePicker.setParsers("ddMMyy", "ddMMyyyy", "dd.MM.yy", "dd.MM.yyyy");

Keep Percentage Formatting when exporting from SSRS to Excel

I have a report that calculates the % of Revenue versus the total Contract Value for a job. In SSRS I have it set to a percentage with 2 decimal points. The format property is set to %0.00. Now when I export to excel it looks great in all cases but one. If the Revenue Amount is $0.00 and its divided by a Contract Value greater then $1 then the value is set to 0.0000000000000000 in Excel and not the 0.00% I expect.
How can I make it so it displays the expected 0.00%?
When creating Reporting Services (SSRS) reports, I have used FormatCurrency() and FormatPercent() around values to make the report look good. I learned that when you use those values, and export to Excel, you end up losing the ability to sum the values and what's on your SSRS report is much different on your Excel worksheet. This is because everything is exported as text.
How to solve this. Remove all the FormatCurrency() and FormatPercent() functions.
On each of your fields, highlight them, then in the properties area, there is a “Format” property. I set that to C2 (C for Currency, 2 for the number of digits after the decimal, so if you wanted zero, it would be C0). Again for Percentages, same thing, highlight all the fields, and set “Format” to P2 (P for Percentage, 2 for the number of digits after the decimal).
Have you tried using P2 in the format property?
The Standard Numeric Formats tend to render better in Excel.
UPDATE:
I have recently had an issue where I was using P1 for the format but the export would be 2 decimal places unless it rounded to 1.
The fix was to use 0.0% for the format property instead of P1. Now all of the cells have the same formatting - even the zeroes.
I tried the suggested answer and it works great for currency. I wanted just plain decimals and ended up going with " #,0;(#,0);'' ". The final parameter makes zero values invisible. Of course, there are a ton of these formats.
Text Box Properties
I got this by using the Number tab on the Text Box Properties dialogue box (right-click the text box and select Text Box Properties). Once I set it, I could return to the Properties window for the text box and see how that action got translated. Then I applied it to all the text boxes in the tablix.
Hope this helps.
TextBox Properties Dialogue Box

Auto page break in libHaru PDF

I'd like to add an automatic page break to a libHaru PDF in iOS.
I do have several text fields in the app which contain the user filled data. when i generate the pdf i first measure the expected size of the text-rect going to be created. if it exceeds the remaining space i trigger a hpdf_new_page event and put the text on an new page. i'd like to have this just in part automatically. so if the text exceeds the space on the current page it should split and continue on a new page without me checking or doing anything.
unfortunately i can't find anything like this in the documentation.
Line counting using fgets() may help. When your print program opens a file to print, each line can be copied to the pdf file and checked for a form feed character
or
if the line count has reached a limit.
Another possible solution is to use a character count limit with "while(getc(file) != EOF)".
This link uses libharu to print basic text files with PCL commands to change the font.
https://github.com/DaDaDadeo/GetCycle/blob/master/pcl_to_pdf.c
The form feed character '\f' (ascii 12) and 61 lines will trigger a new page. There are other conditions in the program to restrict a new page but the general idea is illustrated.
The results are the same as a printer using telnet raw 9100 protocol. The pcl commands are limited to just a couple of font changes so it is not too complicated.
Libharu is rather low-level library, and I could not even expect of appearing such automatic page splitting in newer versions due to number of reasons. Hereafter I state two of them:
There is no good, preferred strategy how to place remaining of non-fitting text on the next page. In some cases it could be even impossible at all.
There is no good, preferred strategy for text splitting.
Why?
Consider your font is extremely large, and just one letter (for instance, wide one as "W") does not fit into the page. Where we are supposed to place it? On the next page? Ok, we add new page... oops, it does not fit this page too - as soon as all our pages have the same size. Dead-end without any good, straightforward way out.
In other words, there should be a user-defined strategy for these cases. Almosy every naive implementation will have such a corner cases.
libharu does not know where it should split your text automatically. It does not know hyphenation rules of your language, it does not know whether it should respect spaces or not (wrap whole words only or not), and so on. It's up to you to specify these rules.
So, you should call HPDF_Font_MeasureText for some part of your text string, decide if it fits into your page (excluding margins, footers - which also out of libharu's internal knowledge) and render it. And note that there is no simple formula for text size depending on its length. String "wwww" is more than twice wider than "iiii", of course if your font is not mono-spaced.

How to do invoice text base reporting in rails?

I would like to build invoice text base to have following format:
https://gist.github.com/samnang/9d35a8622af5779a9228
But when I try to render as text format from my controller, then I find out it's very to control how it look because those text are dynamic like company name could be short or long. I don't want to other texts move position depend on something else because those format will be sent to print company to match print out paper.
Is there any examples, gems, or suggestions how to build invoice text base?
You are going to have to truncate some fields to fit into the defined tab area. If you allocate 20 characters of description data, then you need to only allow 20 characters on the output your_text[0..19]
I think working in text for this type of work is going to be overly complex, and you should look at converting the output to pdf to have more control. Take a look at https://github.com/prawnpdf/prawn

Best Way to Automate Adding Text to an Image and formatting for Printing?

Here's what I have:
Quarter Sheet Flyer (4 per page) as a PSD or JPG
Text file with one entry of text per line.
What I want to do:
Print out 100 flyers (on 25 pieces of paper)
Somehow automate the process of adding the text to the image, either via some scripting language or a Photoshop automated task. Then format the pages to print, either to generate a 25 page PDF file or generate four at a time and send them to the printer page by page.
Anyone have any experience with something like this or have any recommendations on how I should go about doing this?
Thanks for your help!
You can use Microsoft Word automation to generate a word file with the correct text and image, and then just print it.
This would be one of the simpler solutions, you can implement the entire thing as a word macro (VBA).
A more complex solution would be to use VB6 or .net to print the text and the image into the form and then print the form.
You can write a script that will generate an html page with the image and the text, and then print out the html using a browser.

Resources