I have an excel table, and the rows are linked to XML source node. The XML data is refreshed by a query, which returns 0..N rows.
In excel, the table automatically shows the rows - which is good. When it returns 0 or 1 rows - the table shrinks. Nice. When it returns 10 rows, the table expands, shifts the page contents down below the table. When the query returns 1 rows (again), the table shrinks (again), but the shifted content remains shifted - a lot of empty rows remains below the table.
When the query return 12 rows (again), the same happens - table expands, content below the table shifts down again. And again. And again.
I wonder if I can do something against it. The best solution would that creating a fix range for the table to epxand and shrink inside that range - without shifting down the page content.
I read a lot about excel tables - but cannot find any options and settings about it. Could anybody help about it? Or is it impossible? Using VBA is possible.
Related
I have a database, which contains information that I can't share images of due to compliance reasons.
I have a table I need to copy data from, so I was using the following SQL:
INSERT INTO completedtrainingstestfinal (MALicenseNum)
SELECT MALicenseNum
FROM CompletedTrainings
WHERE (CompletedTrainings.MALicenseNum IS NOT NULL)
AND (CompletedTrainings.Employee = completedtrainingstestfinal.Employee);
It keeps popping up the Enter Parameter Value, centered on the new table (named completedtrainingstestfinal) at the Employee column.
Background: The original table is a mess, and this is to be the replacement table, I've had to pivot the table in order to clean it up, and am now trying to remove an ungodly amount of nulls. The goal is to clean up the query process for the end users of this who need to put in training and certification/recertification through the forms.
When you look in the old table, it has been designed to reference another table and display the actual names, but as seen in the image below it is storing the data as the integer number Employee.
The new table Employee column was a direct copy but only displays the integer, my instincts tell me that the problem is here, but I have been unable to find a solution. Anyone have any suggestions to throw me in the right direction?
Edited to add: It might be an issue where the tables have different numbers of rows?
This is the design view of the two relevant tables :
Table 1
Table 2
I have a 4x4 table in SQL with 20 rows. I want to split this data into four pages. Page 1 has the first 10 rows of the first column, Page 2 has the first 10 rows of the second column, etc.
After every four pages, this patern repeats showing the next 10 rows from the first column, etc. How can I arrange this?
I could arrange the data of the 4x4 table into another temporary table with just one column in its schema. Then I could read a single column of this table into my report. But can I instead do this directly without an intermediary table?
The intermediary table sounds like the best solution to me. I'd just write a custom SQL command in Crystal's Database Expert to arrange the data as you see fit.
You could in theory pull this off with repeating subreports in some manner of repeating header, but it would be much less work to have SQL properly format the incoming data for you.
I'm using Excel 2010. I have a Do While loop processing a large table over 100,000 rows long. If it finds a particular cell in the table, it inserts two rows after that cell and copies the contents of that row to the two new blank rows just created. The loop works fine until it gets to about the 20,000 row and then it locks up. Up to that point it is processing perfectly. It does not always lock up on the same row. I'm using a copy, then a paste special to duplicate the row. After the copy paste is done for the row, I clear the clip board with "Application.CutCopyMode = False". If I comment out the copy/paste, the loop successfully completes.
For the amount of data that I'm working with, I would guess that it will insert about 30,000 rows based on the original table. Is there anything odd about copy/paste special that I should know about?
You are working with a table, why do you need to insert rows?
Append them on the end of the table. If the order is an issue a table in a particular order can be put in that order with a sort (a sort key which is probably implicit in your table already).
Better yet - append the new rows to an in memory table object and paste the entire table object to the end of the original table when your loop is complete. This way you also avoid processing your inserted rows, get much simpler logic in the loop, and the process will probably run faster.
First, I commented out the pastes and it failed. The insert of the two rows also failed without the copy and the pastes. My solution was to first order the starting table. As I found a row that needed duplication, I read that row into an Array and then saved the array to the row past the bottom of the table. After processing the table, I then reordered the rows using the order column I first created and then deleted that column. Runs faster then the copy/paste but I lost the cell formatting in the new rows.
I coded a VBA script in Excel which adds new data into a Datasheet with previous information. Before doing that, the new data is copied into a provisional Datasheet. To prevent duplicates, I create an additional column and do a VLOOKUP of IDs. If the ID from the new imported data is already in the Datasheet with the old data, this row is marked as duplicated and will be deleted. The "non-duplicated rows" are then copied into the final Datasheet, where all the data is stored.
Right now I use a column reference (A:A) in the VLOOKUP and I donĀ“t know if maybe this is the reason why the VBA script needs every day more resources and time to run. When I coded for the first time, I did the test with no more than 4,000 rows in the original Datasheet and 4,000 rows in the imported data. The macro was done after 90 seconds. Right now, it needs more than 5 minutes and the Datasheet with data is just 40,000 rows large, while the new data is always around 4,000 rows.
Should I dynamically reference the range in the VLOOKUP instead of using A:A or it doesn't matter in terms of speed?
As mentioned in my comment, there certainly is a way to accomplish this task using VBA, but sometimes the simpliest solution is best. I would reccomend added all 40K records each time and using the "Remove Duplicates" function under the "Data" ribbon using the column that holds your unique value.
I am trying to replicate a word document as a report in Reporting Services 2008r2.
I need to create a table, with some cells spanning more than 1 column. Essentially it's a 3 column table, but sometimes the 2nd column should fill the space of the 3rd.
I can't find a good way of creating this in Report Builder 3 - I have tried using a table and matrix but cannot achieve what I want.
This report is for 1 record, I want a table of data related to a record and do not want to create textboxes and rectangles and arrange them neatly to get what i want.
Each field should have its own row - but some of those rows will be split with 2 values.
Does anyone have a good method to create what I want? Please don't tell me this isn't the 'norm' and how to do the normal way - I need to replicate an existing layout.
I have solved my issue by deleting the 'Header' row from the table. Then using it like a normal table in any MS Office app, I have also ensured that my Dataset only contains 1 row which may have had some bearing on my issue...