Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Centering report viewer in ASP/VB/.NET

Status
Not open for further replies.

dBjason

Programmer
Mar 25, 2005
355
US
Hello

I'm using VS.NET to develop an ASP application. I have a Crystal Report (through the IDE) which works great, my problem is getting the report centered in the ASP page.

I dropped the report viewer on my .aspx page; when I try to center it in the design grid it comes up on the far right in IE. If I place the viewer all the way to the left of the grid it's almost center, but not quite.

When I switch to HTML in the IDE, I can see that it uses absolute position with TOP and LEFT coordinates (as you may tell, I'm no HTML guru). Looks like this:

<CR:CRYSTALREPORTVIEWER id="ReportViewer" style="Z-INDEX: 101; LEFT: 320px; POSITION: absolute; TOP: 158px"
runat="server" Height="50px" Width="350px"></CR:CRYSTALREPORTVIEWER>

Is there any way to just center the thing, without worrying about pixels?

Thanks in advance,
Jason
 
Hi Jason,
What I do in that situation is place the item inside a TABLE tag and use the align properties. Haven't tried this with a Crystal Report before, but it may work. We just pop a new browser with the report as the sole contents normally.
Dave

<table>
<tr width="100%"><td align="center">
<CR:CRYSTALREPORTVIEWER id="ReportViewer" runat="server"> </CR:CRYSTALREPORTVIEWER>
</td></tr>
</table>
 
Thanks! I will definately give that a shot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top