Merged cells when exporting to Excel (ReportBuilder) - delphi

I am using Report Builder (15.03) with Delphi XE3 for reports generating purposes.
In the Print Preview screen there is a printer icon on the left top corner. Clicking on it opens the Print dialog where there is "Print to File" option. Selecting the "XLS Report File" type there will exports the report to Excel file. However if the column width is big enough it will export it into merged cells in Excel. You can see on my second screenshot cells from E till F are merged.
I started face this issue only after we upgraded our Report Builder to XE3 version. In Delphi 5 version there was no problem.
Has anyone faced the same issue before? Is there any way to avoid the cells merging in this case?
Thank you.
Regards,
Alexey

The cells merging can be switched of by setting:
ppReport1.XLSSettings.MergeAdjacentCells := False;
(by default it is True).

Related

Custom Component Icons Not Showing in Delphi 10.3

I just moved from Delphi 7 to 10.3 and was trying to install some of my older (VCL) custom components. I was finally successful in getting the code to compile, but I'm having trouble with something that seems like it should be trivial. The icons for the custom component(s) in the palette show what looks like a default icon instead of the icon(s) I expected. There are lots of posts on here (most are over 5 yrs old) about component icon issues and I've tried self-compiling the .rc file, including the{ $R .rc} in the package source and using the Project/Resources and Images dialog to specify the icons. I've tried 8-bit, 16-bit, 24-bit icons that are 24x24. Then as a test, I followed the exact procedure shown here which included some of the more recent content on this issue that I could find. I tried with bitmap files at full resolution and 32bpp and 24x24 at 8bpp. In both cases, the default icon showed for this test component. I'm probably overlooking something simple, but I'm kind of at a loss on what to try next. Is there a different procedure for specifying icons for custom components in 10.3 compared to older versions?
Edit: An update - I reinstalled my custom component and then rebooted and then was able to see the correct icon reflected in the palette, but here's where it gets strange. The test component I linked above still shows a default icon even after reinstalling and rebooting, and even stranger, is that the second I use my custom component on a form, the icon in the palette reverts to a TEdit icon (the component is a descendant of TEdit). Closing Delphi and reopening restores the icon until it is used again.
I'm not sure whether I should answer my own question, but just wanted to update in case it helps someone later. I was finally able to get the sample test component icon to show by using the -nocache option as described here. I then cleared the registry cache for my own component (dclusr) as shown in the same post and then also changed the bitmaps from 8bpp to 32bpp and now everything seems to be working as expected. I then cleared the registry keys for the sample project, and I can run without the -nocache option and all icons show fine, so I am thinking it was mostly a cache issue which I never would have found without the referenced post.

Simple way to avoid TListView items clipping and replace with ellipsis

I have a TListView in vsSmallIcon mode. If I populate it with 2 items and first item text is longer than second item text it will draw first item over the second.
Is there a quick way to replace longer items with ellipsis? Or a complicated one?
I am using Delphi 2010 and C++ Builder 2010 with default settings of TListView
How it looks:
How I want it to look:
Edit: After trying out vsList style I discovered that the above is no longer an issue and it works without any additional code (no ellipsis but no items clipped also).
When working with TListView I often find myself investigating and mimicking the behavior of Windows Explorer.
Regarding your question with ellipsis in vsSmallIcon mode I checked out Explorer. I observed that when I resize the window there’s no ellipsis drawn for item captions. Instead the items are rearranged instantaneously. My suggestion would be to skip the ellipsis strategy because Microsoft has not implemented Explorer that way and chances of a quick fix for you decrease. If you can settle for rearranging then the two following “quick” alternatives should do the job, at least in XE3.
Alt 1:
ListView1.IconOptions.AutoArrange := true;
Alt 2: (must be called explicitly every time you desire a rearrangement):
ListView1.Arrange(arDefault);
Update:
I fired up Delphi 2006 and can confirm that the above methods work there as well

SSRS - Buttons are Misaligned in IE

I am using SSRS 2008R2 and my deployed reports were working fine. I am accessing these reports in another computer.
I am using IE to access these reports.
At first, I had the usual buttons --> Save As, Refresh, Print and Export to Data Fee
And I was able to print directly from IE using the Print button (not File-Print)
However, one fine day, the alignments of these buttons went from being horizontal to vertical. And the worse part is the Print button is now missing.
PS: I can't post photos. So imagine the buttons becoming vertically aligned and the print button missing. And I am using IE11
Any help or guidance is much appreciated.
Hayashi!
Well, I'm not thrilled about it, but have a look at this page:
http://msdn.microsoft.com/en-us/library/ms156511.aspx#bkmk_reportviewer
Under the table Browser Requirements for Viewing Reports there is a little note stating "Internet Explorer 11, add the report server URL to compatibility view in internet options".
I have tested this and confirmed that when we add our URL to the to IE11's Compatibility View List, the annoying display issues go away.
Not a server-side fix as I was hoping, but came straight from the horse's mouth.
I've found out the problem. My PC automatically updated my IE from 10 to 11.
Since then, this problem occurred. I went to uninstall IE 11 (from Control Panel) and revert back to IE 10.
Problem solved!
Hayashi

CodeBar component disappearing when sending to Printer

I'm trying to develop a report in Delphi XE4 and Report Builder 15.01 using CodeBar component.
When I print to screen the print is normal, but when I send that print to the printer, the codebar component disappear from the print, leaving just a blank space in its place.
I'm not changing its properties in runtime.
What could it be?
Edit:
The CodeBar component only disappear when the device is "Printer", if I change it to PDF for example, it prints correctly.
Edit2:
I have found another behavior: the Codebar doesn't disappear, it creates another codebar inside, with the same properties, but just visually. I could post images to make thing much clearer but i don't have anough rep points. lol.
Edit3:
I have tryed the version 14 and for my surprise the problem doesn't exist. I guess it's a bug from RB.
Well, after changing the version to 14 the problem has been solved. Not only this problem but some others layout problems.

Delphi (RAD Studio XE2): How can I print the contents of a DBGrid or ADOQuery?

On the program I am working on for a school project, there is a results page which displays the contents of a database in a DBGrid using a ADOQuery component. I have a button on the page which when I click it, it should print whatever the contents of the DBGrid is with a printer.
The printer setup is already done with a PrintDialog component, I know how to do that part, the problem is finding a way to print the contents of DBGrid.
The desired result would be to print all the data in the DBGrid, not just that shown on screen but whatever might be found if you scroll down in the DBGrid, as it is shown on the DBGrid onto a page, that could be printed to a physical paper or a electronic document, as chosen in the PrintDialog component.
I'll check up on the FastReports thing as suggested by some commentors. Does that have any dependancies when the program is run on another computer, as in does the computer also need FastReports installed?
Is this possible? If it is, how? Thanks in advance for any help in this matter.
I'm sorry if the question was/is not clear enough, I thought it was clear enough but that just goes to show how inexperienced I am.

Resources