Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32058

Merge Jquery Grid Two cells has the same values together

$
0
0

I have one Jquery Grid ,

binded data from DB,

the issue is i need to merge cells in column one that has the same values toegter.

Below is my code

<htmlxmlns="http://www.w3.org/1999/xhtml"><headid="Head1"runat="server"><title></title><!-- The jQuery UI theme that will be used by the grid --><linkrel="stylesheet"type="text/css"media="screen"href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.0/themes/excite-bike/jquery-ui.css"/><!-- The jQuery UI theme extension jqGrid needs --><linkrel="stylesheet"type="text/css"media="screen"href="themes/ui.jqgrid.css"/><!-- jQuery runtime minified --><scriptsrc="http://ajax.microsoft.com/ajax/jquery/jquery-1.9.0.min.js"type="text/javascript"></script><!-- The localization file we need, English in this case --><scriptsrc="js/trirand/i18n/grid.locale-en.js"type="text/javascript"></script><!-- The jqGrid client-side javascript --><scriptsrc="js/trirand/jquery.jqGrid.min.js"type="text/javascript"></script><styletype="text/css">.ui-jqgrid tr.jqgrow td{height:100px;font-size:large;font-weight:bold;}$("#grid").closest("div.ui-jqgrid-view").children("div.ui-jqgrid-titlebar").css("text-align","center").children("span.ui-jqgrid-title").css("float","none");</style><styletype="text/css">
        body {font-size:75px;}</style></head><body><formid="form1"runat="server"><asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ connection string value %>"
        SelectCommand="select distinct M.MINOR_NM [SVC Type],'In Warranty' WTY,
(select count(*) Total from w_job_header_usg105 a where  a.job_status&lt;'60'   and a.Cost_type='W1' and Service_type in ('T1')) Total,
(select count(*)  from w_job_header_usg105 A where a.job_status&lt;'60' and a.Service_type in ('T1') and DateDiff(dd ,CONVERT(VARCHAR(10),a.RECEIPT_DT,120),getdate())&lt;=3 and  Cost_type='W1' ) '0~3 Days',
(select count(*)  from w_job_header_usg105  where   job_status&lt;'60' and Service_type in ('T1') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;3 and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&lt;=7 and  Cost_type='W1' ) '4~7 Days',
(select count(*)  from w_job_header_usg105 where   job_status&lt;'60' and Service_type in ('T1') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;7 and  Cost_type='W1' ) 'Over 7 Days'
from mytabe1 J join mytabe2 M on J.Service_type=M.Minor_cd and M.Major_cd='WA003'and J.Service_type in ('T1')

 Union

select distinct M.MINOR_NM [SVC Type],'Out Of Warranty' WTY,
(select count(*) Total from w_job_header_usg105 a where  a.job_status&lt;'60'   and a.Cost_type in('W6','') and Service_type in ('T1')) Total,
(select count(*)  from w_job_header_usg105 A where a.job_status&lt;'60' and a.Service_type in ('T1') and DateDiff(dd ,CONVERT(VARCHAR(10),a.RECEIPT_DT,120),getdate())&lt;=3 and  Cost_type in ('W6','')) '0~3 Days',
(select count(*)  from w_job_header_usg105  where   job_status&lt;'60' and Service_type in ('T1') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;3 and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&lt;=7 and  Cost_type in ('W6','')) '4~7 Days',
(select count(*)  from w_job_header_usg105 where   job_status&lt;'60' and Service_type in ('T1') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;7 and  Cost_type in ('W6','') ) 'Over 7 Days'
from W_JOB_HEADER_USG105 J join B_MINOR M on J.Service_type=M.Minor_cd and M.Major_cd='WA003'and J.Service_type in ('T1')
Union

select distinct M.MINOR_NM [SVC Type],'In Warranty' WTY,
(select count(*) Total from w_job_header_usg105 a where  a.job_status&lt;'60'   and a.Cost_type='W1' and Service_type in ('T4')) Total,
(select count(*)  from w_job_header_usg105 A where a.job_status&lt;'60' and a.Service_type in ('T4') and DateDiff(dd ,CONVERT(VARCHAR(10),a.RECEIPT_DT,120),getdate())&lt;=3 and  Cost_type='W1' ) '0~3 Days',
(select count(*)  from w_job_header_usg105  where   job_status&lt;'60' and Service_type in ('T4') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;3 and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&lt;=7 and  Cost_type='W1' ) '4~7 Days',
(select count(*)  from w_job_header_usg105 where   job_status&lt;'60' and Service_type in ('T4') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;7 and  Cost_type='W1' ) 'Over 7 Days'
from W_JOB_HEADER_USG105 J join B_MINOR M on J.Service_type=M.Minor_cd and M.Major_cd='WA003'and J.Service_type in ('T4')

 Union

select distinct M.MINOR_NM [SVC Type],'Out Of Warranty' WTY,
(select count(*) Total from w_job_header_usg105 a where  a.job_status&lt;'60'   and a.Cost_type in('W6','') and Service_type in ('T4')) Total,
(select count(*)  from w_job_header_usg105 A where a.job_status&lt;'60' and a.Service_type in ('T4') and DateDiff(dd ,CONVERT(VARCHAR(10),a.RECEIPT_DT,120),getdate())&lt;=3 and  Cost_type in ('W6','')) '0~3 Days',
(select count(*)  from w_job_header_usg105  where   job_status&lt;'60' and Service_type in ('T4') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;3 and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&lt;=7 and  Cost_type in ('W6','')) '4~7 Days',
(select count(*)  from w_job_header_usg105 where   job_status&lt;'60' and Service_type in ('T4') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;7 and  Cost_type in ('W6','') ) 'Over 7 Days'
from W_JOB_HEADER_USG105 J join B_MINOR M on J.Service_type=M.Minor_cd and M.Major_cd='WA003'and J.Service_type in ('T4')

Union
select distinct M.MINOR_NM [SVC Type],'In Warranty' WTY,
(select count(*) Total from w_job_header_usg105 a where  a.job_status&lt;'60'   and a.Cost_type='W1' and Service_type in ('T2')) Total,
(select count(*)  from w_job_header_usg105 A where a.job_status&lt;'60' and a.Service_type in ('T2') and DateDiff(dd ,CONVERT(VARCHAR(10),a.RECEIPT_DT,120),getdate())&lt;=3 and  Cost_type='W1' ) '0~3 Days',
(select count(*)  from w_job_header_usg105  where   job_status&lt;'60' and Service_type in ('T2') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;3 and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&lt;=7 and  Cost_type='W1' ) '4~7 Days',
(select count(*)  from w_job_header_usg105 where   job_status&lt;'60' and Service_type in ('T2') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;7 and  Cost_type='W1' ) 'Over 7 Days'
from W_JOB_HEADER_USG105 J join B_MINOR M on J.Service_type=M.Minor_cd and M.Major_cd='WA003'and J.Service_type in ('T2')

 Union

select distinct M.MINOR_NM [SVC Type],'Out Of Warranty' WTY,
(select count(*) Total from w_job_header_usg105 a where  a.job_status&lt;'60'   and a.Cost_type in('W6','') and Service_type in ('T2')) Total,
(select count(*)  from w_job_header_usg105 A where a.job_status&lt;'60' and a.Service_type in ('T2') and DateDiff(dd ,CONVERT(VARCHAR(10),a.RECEIPT_DT,120),getdate())&lt;=3 and  Cost_type in ('W6','')) '0~3 Days',
(select count(*)  from w_job_header_usg105  where   job_status&lt;'60' and Service_type in ('T2') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;3 and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&lt;=7 and  Cost_type in ('W6','')) '4~7 Days',
(select count(*)  from w_job_header_usg105 where   job_status&lt;'60' and Service_type in ('T2') and DateDiff(dd ,CONVERT(VARCHAR(10),RECEIPT_DT,120),getdate())&gt;7 and  Cost_type in ('W6','') ) 'Over 7 Days'
from W_JOB_HEADER_USG105 J join B_MINOR M on J.Service_type=M.Minor_cd and M.Major_cd='WA003'and J.Service_type in ('T2')"></asp:SqlDataSource><trirand:JQGridrunat="server"ID="JQGrid1"DataSourceID="SqlDataSource1"Height="100%"KeyboardNavigation="False"Width="1310px"AutoWidth="True"onprerender="JQGrid1_PreRender"><TreeGridSettingsEnabled="True"/><ViewRowDetailsDialogSettingsCaption="Pending Jobs Report"/><AppearanceSettingsCaption="Pending Jobs"/><Columns><trirand:JQGridColumnDataField="SVC Type"Searchable="False"Sortable="False"TextAlign="Center"CssClass="ui-jqgrid"/><trirand:JQGridColumnDataField="WTY"TextAlign="Center"/><trirand:JQGridColumnDataField="Total"TextAlign="Center"/><trirand:JQGridColumnDataField="0~3 Days"TextAlign="Center"/><trirand:JQGridColumnDataField="4~7 Days"TextAlign="Center"></trirand:JQGridColumn><trirand:JQGridColumnDataField="Over 7 Days"TextAlign="Center"></trirand:JQGridColumn></Columns><SearchDialogSettingsDraggable="False"/></trirand:JQGrid></form></body></html>

The resut comes as below



Viewing all articles
Browse latest Browse all 32058

Trending Articles