Excel Export Splitting columns up

I have a Report viewer in ASP.NET.  I have a report displayed that works fine.  The report viewer has the option to export the data to an Excel file or PDF file.  When the user exports the file to Excel, Excel takes the lines of data and splits it up into 2 columns, as in the screen shot below.  I have all of the columns lined up in the Report in Visual Studio.  The columns are, however, in different matrices in Visual Studio.  Anyone have any ideas on how to get the data into one column?
LVL 15
melli111SharePoint Administrator / DeveloperAsked:
Who is Participating?
 
Saqib Husain, SyedConnect With a Mentor EngineerCommented:
Ok then without the sample try this macro


Sub Realign()
    For Each cel In Intersect(ActiveSheet.UsedRange, Range("G5:G" & ActiveSheet.Rows.Count))
    If cel.Value = "" And cel.Offset(0, 1).Value <> "" Then
        cel.Delete Shift:=xlToLeft
    End If
    Next cel
End Sub

Open in new window

0
 
melli111SharePoint Administrator / DeveloperAuthor Commented:
0
 
Saqib Husain, SyedEngineerCommented:
select cells E9:E30

right-click on the selection

select delete

select shift cells left
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
melli111SharePoint Administrator / DeveloperAuthor Commented:
I understand how to do that, my question was more along the lines of is there anything I can do programatically to fix this issue?  Or the alignment of the report elements in Visual Studio?  I want to do this as there are users who are not as proficient in Excel as you or I.
0
 
Saqib Husain, SyedEngineerCommented:
Hello, I just found this question in my open questions. Do you want to continue with it?
0
 
melli111SharePoint Administrator / DeveloperAuthor Commented:
Yes, I would like to.  I have not found a solution yet.
0
 
Saqib Husain, SyedEngineerCommented:
Can you please upload a sample if they are all in a same format? If the format changes then send at least two so that I can see the variation.
0
 
melli111SharePoint Administrator / DeveloperAuthor Commented:
I've requested that this question be deleted for the following reason:

No longer needed
0
 
Saqib Husain, SyedEngineerCommented:
You asked for a solution and I gave it. You should either accept it or, if it does not work as expected, comment on it so that it may be addressed.
0
 
Saqib Husain, SyedEngineerCommented:
#35869182 works with the layout shown in the screenshot after the question
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.