1.水晶报表传参及绑定
Dim sType1 As New CrystalDecisions.Shared.ParameterValues
![](/Images/OutliningIndicators/None.gif)
Dim sType1a As New CrystalDecisions.Shared.ParameterDiscreteValue
![](/Images/OutliningIndicators/None.gif)
sType1a.Value = Me.Lab_Data.Text.Trim
sType1.Add(sType1a)
rptPre.DataDefinition.ParameterFields("print_name").ApplyCurrentValues(sType1)
![](/Images/OutliningIndicators/None.gif)
rptPre.SetDataSource(objDsRptPre)
Me.CrystalReportViewer1.ReportSource = rptPre
2.DataView.Find 方法的应用
今天为了使DataGrid的当前行为刚才插入的新行,使用到这个方法。
该方法的说明:
按指定的排序关键字值在 DataView中查找行。
该方法的例子如下:
Private Sub FindValueInDataView(t As DataTable)
Dim dv As DataView
Dim i As Integer
Dim vals(1) As Object
dv = New DataView(t)
dv.Sort = "Cusomers"
' Find the customer named "John Smith".
vals(0)= "John"
vals(1) = "Smith"
i = dv.Find(vals)
Console.WriteLine(dv(i))
End Sub
照上面的例子,字段“Cusomers”必须为dv中排序的字段。如果要解决我上面提的问题。就要必须知道我新插入的行的“Cusomers”字段的值为John Smith,然后
DgdGrid.CurrentRowIndex = dv.Find("John Smith")
declare @print_no as nvarchar(12)
declare @print_name as nvarchar(12)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
declare cur2 cursor for
SELECT print_no,print_name
FROM Pro_PrintInfor
WHERE .
open cur2
fetch next from cur2 into @print_no,@print_name
![](/Images/OutliningIndicators/None.gif)
while @@fetch_status=0
begin
/* do what you want to do with @print_no and @print_name
*/
fetch next from cur2 into @print_no,@print_name
![](/Images/OutliningIndicators/None.gif)
end
![](/Images/OutliningIndicators/None.gif)
close cur2
deallocate cur2
5.在Html代码里设定DataGrid的列标题
<asp:BoundColumn DataField="TO_TYPE" ReadOnly="True" HeaderText="类别">
<HeaderStyle Wrap="False"></HeaderStyle>
</asp:BoundColumn>
6 在Html代码里设定带有外部控件的模板列
<asp:TemplateColumn HeaderText="物料实际日">
<HeaderStyle Wrap="False"></HeaderStyle>
<ItemTemplate>
<asp:Label id="Label4" runat="server">
<%# ((DateTime)DataBinder.Eval(Container.DataItem,"IS_QZ_DATE")).ToString("yyyy-MM-dd")%></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<cc1:Calendar id="Calendar1" runat="server" Width="100px" value=<%# ((DateTime)DataBinder.Eval(Container.DataItem,"IS_QZ_DATE")).ToString("yyyy-MM-dd")%>></cc1:Calendar>
</EditItemTemplate>
</asp:TemplateColumn>
7 在Html代码里设定带有linkButton的模板列
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="保存" CancelText="取消" EditText="修改">
<HeaderStyle Wrap="False"></HeaderStyle>
<ItemStyle Wrap="False"></ItemStyle>
<FooterStyle Wrap="False"></FooterStyle>
</asp:EditCommandColumn>
8 往Sql数据表插入图片和从数据表中取图片显示
http://dotnet.aspx.cc/ShowDetail.aspx?id=J9UBRVER-L3VB-49M3-GOU1-Z6C2PVR6FZ3K
9 使用MainManu
a.设置主窗体的IsMidContainer=true
b.新窗体的MdiParent=主窗体(VB.NET中的Me)
c.通过设置菜单项中MidList=true 来实现一般的窗口功能
10水晶报表中的多列显示数据
a在“详细资料”节中点击格式化节
b在弹出的界面中,“共用”,勾选多列格式化,然后在布局中设置有关属性。可以多测试几次。
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
rptPre.DataDefinition.ParameterFields("print_name").ApplyCurrentValues(sType1)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
Me.CrystalReportViewer1.ReportSource = rptPre
2.DataView.Find 方法的应用
今天为了使DataGrid的当前行为刚才插入的新行,使用到这个方法。
该方法的说明:
按指定的排序关键字值在 DataView中查找行。
该方法的例子如下:
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/None.gif)
照上面的例子,字段“Cusomers”必须为dv中排序的字段。如果要解决我上面提的问题。就要必须知道我新插入的行的“Cusomers”字段的值为John Smith,然后
![](/Images/OutliningIndicators/None.gif)
就可以了。
2005/8/26
3.关联多个dataset的DataTable
dataset 表关联用的是Relations.Add,但不同dataset 的DataTable不可以在Relations.Add里直接调用DataSet的DataTable(如果直接调用,会提示这个表已经属于另一个DataSet)。必须使用使用DataSet的DataTable的Copy
4.使用游标的格式
例子:
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
5.在Html代码里设定DataGrid的列标题
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
6 在Html代码里设定带有外部控件的模板列
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
7 在Html代码里设定带有linkButton的模板列
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
8 往Sql数据表插入图片和从数据表中取图片显示
http://dotnet.aspx.cc/ShowDetail.aspx?id=J9UBRVER-L3VB-49M3-GOU1-Z6C2PVR6FZ3K
9 使用MainManu
a.设置主窗体的IsMidContainer=true
b.新窗体的MdiParent=主窗体(VB.NET中的Me)
c.通过设置菜单项中MidList=true 来实现一般的窗口功能
10水晶报表中的多列显示数据
a在“详细资料”节中点击格式化节
b在弹出的界面中,“共用”,勾选多列格式化,然后在布局中设置有关属性。可以多测试几次。