Mail merge picture size using Gembox Document - gembox-document

I’m using the mailmerge feature of Gembox.Document to produce reports.
I’m having issues with the sizing of a picture.
I have created a merge field inside a table cell, and I would like the picture to occupy the maximum of the cell size without changing it’s aspect ratio.
For now it’s inserting the picture, but the ratio is all messed up.
I’ve read in the help page that I could put a shape my merge field but after many attempts I don’t know how to do it, when I try to draw the shape in my word template, it doesn’t go inside my merge field.
Can anybody help me with this ? Either to fix the aspect ratio, or how to use the shape…
Cheers

Take a look at the second Merge Pictures example, its input "MergePicturesWithTemplates.docx" file has MergeFields with Shapes inside.
To place a Shape inside a MergeField, draw the shape, set it as "In Line with Text", and drag it inside the field.
Now that you have a shape as a placeholder for your image, you can add switches to MergeField in order to keep the aspect ratio of the merged picture:
\x - resize resulting picture horizontally, keep the template shape's height.
\y - resize resulting picture vertically, keep the template shape's width.
\x \y - resize resulting picture either horizontally or vertically.
To add a switch, press ALT + F9 in MS Word, that will reveal field's code and then write the switch within.

Related

Graphs the same size in gnuplot multiplot when each take up most of its canvas and one has labels

I've reedited this question a few times: I've made some good progress!
So, as I understand it, multiplot splits the whole canvas up into equal sized parts as needed. This is a little weird when your different plots have different dimensions, as in my case, but it works. The problem might come in when the graph are supposed to be very close together (e.g. each takes up most of its canvas), but one of them has labels. In that case, it seems the plot with labels must resize to be smaller so everything can fit. That's where I am now.
I see a few options.
make all the plots farther apart-- but I don't want to do that.
somehow make the label not part of the multiplot-- I would totally do this, but I don't know how. It's possible even just the axis tics themselves would be too big, but I can probably deal with that or compromise just that amount on the spacing.
So my question is, how can I put words in a gnuplot graph, completely separately from a plot?
(The picture is also giant, which is unfortunate, it was the only way I could make the formatting work)
Two things:
Multiplot has a convenience mode layout <rows>, <columns> that, as you say, splits the page into equal rectangles. But you do not have to use this convenience mode; you can assign each sub-plot to any arbitrary rectangle on the page, even one that overlaps or is interior to another rectangle. Here is an example from the online demo set that is close to what you show:
Demo of multiple plots with explicit alignment of borders
Placing text anywhere on the page: The set label command allows you to position the text using screen coordinates rather than plot coordinates. For example, to place a single large label centered at the top of a page that contains multiple plots:
set label 1 "This label is positioned independent of all plots"
set label 1 at screen 0.5, screen 0.95 center
set label 1 font "Times,20"

SSRS bar chart issue

I am trying to add one box and one line on x-axis. Please look at below bar chart.
I tried using stripline but I cannot set height for stripline. It goes till 100.
Is there any way I can do this?
Unfortunately, SSRS doesn't provide the functionality you're looking for. A stripline is the closest you can get to that, but like you said, you can't control its height. The only way you could simulate this behavior would be to use a Background Image for your stripline, but that may be more work than it's worth. It would require a lot of manual adjustment to get the image to line up on the chart.
I would add a series to the chart using the Stock chart (under Range). In the Series Properties I would set the High value to the height desired for your line (~52 in your example). Ideally this would come from a dataset value.
Set the Low, Open and Close values to 0.
Try two Stripe Lines. First, create the strip line which represents the vertical value you're after. In my case, I made one that was 50% of the graph height off of the Y-Axis.
Chart Properties:
Height of StripeLine:
Once the stripe line is the correct height for the chart, create a 'mask' stripe line along the X-axis that will cover the portion of the Y-axis line you want hidden.
Chart Propterites:
Width of Stripe Mask:
Using these methods, and some really clever expression writing, you should be able to make the line exactly as high, and as wide as you desire.

PostGIS clipping raster with the same color band as the orignal raster

I am trying to clip a raster so that the clipped raster would have the same minimum and maximum values for the color band as the original raster.
For example if i clip the raster with this command:
create table clipped AS SELECT
ST_Clip(rast,ST_MakePolygon(ST_GeomFromText ('LINESTRING(424920
7370964,
424920 7371476,425432 7371476,425432 7370964,424920 7370964) ')) ) FROM original;
I get the following result:
So the clipped raster has band minium value as 0 and maxium value as 20. Instead of that, i want it to be exactly same as the 'original' raster: from 0 to 33.
I am new for PostGIS, but i have tried to find an answer for a while to this question but i haven't found anything. I have tried the functions like ST_Reclass but with no success. What is the proper way to do this with PostGIS?
Why is that happening?
The reason that your range changes is because your maximum value (33 in your case) is not contained within the area you clipped. This is not a bad thing, its just a fact. It's not a PostGIS thing, its just a clipping thing.
Can we find a solution?
I'm guessing that the real problem you want solved is that the two rasters look very different in QGIS. That's really easy to fix! I'll show you how with some example data.
Exmaple Data
Here's what we're starting with:
Link to image because I don't have enough rep to embed an image yet, I guess...
Double click on the "clipped" layer to open up the "Layer Properties" window and select the Style tab from the list on the left side of the window
Locate the text window for "Max" and change it to 33 to match your original raster. This picture may help. It's worth noting that you may run into a case where your Minimum is different in the clipped raster as well like it is here. You can adjust that in the same fashion.
Apply your changes and watch them work!

How to resize a responsive list from three columns to one (using responsivegridsystem.com)

I am using www.responsivegridsystem.com for my columns and here is what I've come up with: ux.stoicdigital.com/#intro-message.
I'd like the list to work like this one: http://doyouimpress.com/#uses-list
The biggest problems are that, above a certain amount of px (can't remember exact), the three column grid is centered, but doesn't LOOK centered due to cell widths, etc. and that below that amount of px (when list is in one-column mode), the off-center problem is even worse.
Again, I realize that this has to do with cell widths, etc. but I can't figure out where to make the changes I need to do the following at both sizes:
Align text and bullets left
Center the list itself on the page
Any advice would be appreciated. Would especially appreciate any details you can give re: changes to make to CSS.
PS: If there is another way to achieve this outside of Responsive Grid System, I'm open to that too.
The text doesn't look centered because it isn't. The container div is centered, but since you align the text to the left its all scewed to the left, just like it'd be scewed to the right if you aligned the text to the right.
You could align the text to the middle, but then your checkbox icons wouldn't be lined up. If you want the text to be centered but still have the icons lined up you need to attach the icons so something else but the text. You could display them as pseudo-elements to the <li>, but the drawback is that there would be varying amounts of space between the text and the icons.
What I'm coming at is basically that you can't center the columns this way (as long as you don't make sure that the text in each <li> is equally wide) - however you can fake it and that's what they do on that site you're referring to.
To fake it, simply give each column div a unique class name (or target them with :nth-child), then move each column manually to make it look like the content is centered. You could give them different width-values (this is what they do in your example), different padding-values or similar. That's entirely up to you.
As for the one-column layout, do something similar where you add a padding-value to push them closer to the center, but obviously use the same value for all column divs.

SSRS indicator sizing

When adding an indicator to a report as per the image, is it possible to have all the indicators the same size regardless of the cell size (so centre them all rather than stretching to fill the cell)
Use rectangles within the cells of the table: within these, objects can be easily sized to not take full height or width.
Yes, sizing the rectangles and their contents can be annoying. I don't try to do much of this with the mouse, I quickly fall back to the properties window where I can type position and size.
try clicking on the indicator area (default name ie GaugeReportItem) within GaugePanel. You will get Size and position in Properties on the right hand side where you can choose AutoLayout. This will in effect center and resize gauges based on the cell width, height and your settings.
Hope it helps.
Exporting SSRS report to Excel did not go as expected.
Report with indicators in rectangles exported to Excel was randomly adding 0 height rows between the records which was not what I wanted. My indicators where simple green ticks and red crosses, based on true false. I have tried everything I found out there, even a subreport for indicator. No luck...
Figured it out that the indicators randomly outgrows the parent item when you export it, just like a chart. Ended up with saving a tick and a cross as an image. Then used an image control(with fit proportional set) and embedded Image with conditional statement to pick specific image. Also added some padding not to overlap borders.
The only problem I could think of is if the background of the report is not white as I could not change the background color of the cell the Image is and there is no option for the Image background.
Hope this helps someone else.

Resources