MS Word mail merge, multiple columns into rows, dynamic table - ms-word

im creating a invoice template for mail merge using Word. In my source excel sheet, each row represent different invoice, but each invoice can have one or two items. I want to list this items in dynamic table inside my Word document. So if particular invoice has one item, i want the table to have one row, if the invoice have two items i want the table to have two rows. Columns in my source excel are: InvoiceNumber, Date, InvoiceItem1Value, InvoiceItem2Value. So the last two columns represents my invoice items, if they are both filled, then the table in my output document will have 2 rows, each containing one of the value. If only one column will be filled, then the output table will have only one row with a value from that filled column. Can you tell me how to do that?

What you are seeking is a Many-to-one mail merge. Mail merge wizard by default performs one-to-one mail merge i.e. it creates one document for each row in Excel. In your case if an invoice has two items, it will create two documents.
If you are looking for an online many-to-one mail merge, try EDocGen. If your organization is less rigid with security, you may also try add-ins from Graham Mayor and Doug Robbins. Incidentally, I published a blog for many-to-one mail merge few weeks back with a similar use case.

Related

Linking tables where record in one table has a prefix and other does not

I am creating a report which will allow me to reprint invoices using information from two different tables from Sage 300 accounting/job costing sofware.
I have one table that has an invoice number of "123456" and another table that has an invoice number of "SM123456" referring to the same invoice. The second tables adds the "SM" so that it knows that the invoices was sourced from a particular module. Is there any way to link these?
I have tried creating a report with a formula to remove the SM from one of the tables so that it can be linked to a subreport. However the subreport that I want to print is already using subreports and the second tier subreports are not printing data that is needed.
I am open to any other suggestions.
Thank you,

Crystal Reports Incorrect Grand Total

I tried looking for the answer but all the questions were more complicated, needing more complicated answers.
I'm trying to find the sum of a column in Crystal Reports, putting it into the footer, but when I do it gets a grand total that is totally incorrect. For example, i want to find the sum of the column balance, which has only got one row with £0.68, but CR puts £69.36. I have had to suppress the duplicates, so that probably has something to do with it, but since i'm new to everything code related I need some help.
The duplicate values you are seeing most likely are not a bug, but rather are data columns that have a many-to-one relationship with other data columns in a joined data table. Which is when grouping your data becomes necessary. For example, within a database one Invoice record typically joins with 1 or more Invoice Detail records. Each Invoice Detail record will have the same Invoice Number, and you will have duplicate Invoice Number values in your report. You say you begin by filtering your report to a single customer, but if that customer has more than one invoice, without a grouping level on Invoice Number, then the details section is the only place you can print the Invoice Number and it will duplicate over and over again for each item on the invoice that is defined on your Invoice Detail table. By grouping on Invoice Number you can use the group header section to print data fields that have a 1-to-1 relationship with any one invoice without duplicating them. Then you can use a summary field in the group footer section that properly reflects your grouped data without counting the duplicate values.

libreOffice, is automation possible to delete empty table rows?

I have a mail merge generated document which comprises repeats of a template with a fixed number of table rows in.
In some of the repeats few of the rows are used.
Is there a way to delete all empty rows across all tables in the document en masse?
TIA

Is it possible to create a row that spans all columns of a Matrix in SSRS 2008?

Is it possible to have add a row to an SSRS 2008 Matrix that spans all of the matrix's columns?
This crude diagram shows roughly what I'm looking for:
The basic idea is that each line item is a person, and each column is a field in a form for that person. The fields themselves are dynamic (and implemented as column groups on the matrix). Additional column groups are included to append non-dynamic form fields, like the time the record was entered and who entered it. Under each person's record is a comments field, which should span all of the form fields above it.
At the moment I have the matrix embedded in another tablix, with the name and fields in the matrix and the comments in the parent tablix. This works for the data (each instance of the matrix ends up being one row), but the header repeats too often (once per person) because it's attached to the matrix. The only thought I have as to how to fix this is to create another matrix in the parent tablix with the same grouping and use it to display the headers... But this will require quite a lot of manual synchronization to keep the two matrices the same.
Edit: The key problem here is making the second row span multiple column groups.
Here's what you can do:
Select the column grouping you want to add above and right click and select
Add Group... Parent Group...
Group the column by something that will not aggregate the data. You'll have to select a field from your dataset to group by so that it creates an overlapping column grouping.
Check the Add group header box
You should now see something similar to this:
Now you just need to move the Value1 field and it's header over under the new column to the right beyond the matrix dividers. Once that's done, simply delete the ungrouped column where you just copied Value1 from and be sure to select Delete columns only checkbox.
Your finished product should look like this:
It is possible - And the above answers are partial answers leaving out one key step: Merging the cells of the child row.
First, right click on your grouped row, then select Insert Row -> Inside Group - Below and you will get two rows with the cells aligning on the columns
Second, ctrl click all the cells in your new row (ie row without the data) then right click on one of the highlighted cells, and then select Merge Cells.
Now you have the table you like. To add a value to the new row: first right click your new (multi column) cell,select Create Placeholder, and then add the dataset item you desire to the placeholder.
[Edit]
After several attempts, I'm going to say this isn't possible in SSRS. The best I could come up with is a group footer that spans columns 1,2, and 3, but not the User column.
[Original Response]
I recently did something similar to this.
First, what tool are you using to create SSRS reports? (I used SQL Server Business Intelligence Development Studio)
You'll want to create a row group (grouped on Person)
Append a row to your table in "Design" view (Right click, "Insert Row --> Inside Group - Below").
Add an expression to the row that pulls the value for your "Comment" column (=Fields!Comment.Value).
Let me know if that helps...
Try adding in you column group "header" with a grouping expression of (1=1). Then a detail field will need to be defined. If you define the other group with correct data then the "header" will stretch across all details columns. You may need to merger depending on other options.
The easiest way to do this is to create a Tablix with only one column, and your row grouping.
Then, you create two rows inside this group.
In the first row inside the group, you insert a Matrix, wich you can then subgroup as you prefer.
I just had a similar problem, and this was my solution.
I banged my head against the wall for a lot of time, until i realized the solution to my problem wasn't "making a cell span multiple column groups", but "making a cell split into multiple column groups".
You can accomplish the goal by using a subreport for each person. The subreport will receive the employee id and create the hierarchy for you. Make sure your subreport column widths match the widths of the parent report.

Crystal Report- How can i count records of users from different related tables?

I am using Crystal Report2008.I have user table, this table is linked with other table such as devises, photos, videos, emails, notes, texts by its Uid and users have record in all different tables. I want a report which shows that how many record each user has in each table.
I am also getting this error: "More than one data source or a stored procedure has been used in this report. please make sure that no SQL Expression is added an no server-side group-by is performed."
Thank You
With the tables linked, it is not possible to get an accurate count. Your joins will affect how many records are returned.
You need to write one report for each table. If there's a need to see the numbers all on one page, you could write a subreport for each table then put the subreports all together on one page.