如何获取数字左对齐或居中对齐 [英] How to take numbers Left aligned or center aligned

查看:128
本文介绍了如何获取数字左对齐或居中对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生,
当报表生成时,我将sqlserver中的数据转换为excel文件,将所有数字右对齐,以便占用大量空间,我希望它居中或左对齐,以便在我打印页面时不应超出该页面

我在sqlserver2005中的表

序号日期结束时间开始时间项目模块表单工作类型状态备注
1 12/12/2011 09:30 10:30 ABBank PIS MasterForm编码50%确定

所有数字都右对齐如何通过使用gridview将其设置为左或居中我所有数据都输入dt,然后将dt转换为excel

请指导我

Hello Sir,
I m Converting data in sqlserver to excel file when the report is generating all numbers are coming right aligned so that it is taking lots of space I want it to be center or left aligned so that when I print page it shouldn''t go beyond that page

my table in sqlserver2005

Sr.No. Date EndTime StartTime Project Module Form WorkType Status Remarks
1 12/12/2011 09:30 10:30 ABBank PIS MasterForm Coding 50% ok

all numbers are coming right aligned how to set it left or center I m doing by use of gridview all data comes in dt then that dt convert to excel

Please Guide me

推荐答案

与SQL无关-它只是返回一个数值,该数值将通过您使用的任何显示软件进行格式化以进行演示.查看显示元素的工作原理-您说它已转换为Excel,它会自动对数字值进行格式化以进行显示,因此您需要查看代码的这一部分的工作方式.由于我们不知道您如何显示数据,因此无法为您提供特定的解决方案.
This has nothing to do with SQL - it is just returning a numeric value which is being formatted for presentation by whatever display software you are using. Look at how the display element works - you say it is converted to Excel, which automatically right formats numeric values for presentation, so you need to look at how that section of your code is working. Since we don''t know how you are displaying the data, we can''t give you a specific solution.


这篇关于如何获取数字左对齐或居中对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆