Latest Posts

Tuesday, July 8, 2014

Crystal Report Tip : Lines & Boxes over the watermark

Problem :  Lines & Boxes will always be under the Watermark Image in Crystal Report

Solution :   Using Sub Reports


1. Create 2 separate reports. The 1st report will be the main report and the 2nd will be a sub report.
2. Place all page headers and footers on the main report.

Create a Sub report
3. Go to your sub report and place your data and lines on it.
Main Report
4. Right click on the PageHeaderSection and insert section below.
5. On the new PageHeaderSection, insert the image(your watermark) and set the section to Underlay Following Sections.
6. Again, right click on the PageHeaderSection and insert section below.
7. On the new PageHeaderSection, right click, Insert->Subreport
8. Select Choose a Crystal Report in a project, then click the 2nd report you've created.

The lines will be now on the top of the image! Just be sure to remove the borders of your sub report.

Reference from CodeProject 

Sunday, March 30, 2014

Oracle Tip: Recover Deleted Rows from a Table

Problem : Recover deleted rows from a table

Solution : Using timestamp you can recover the deleted data form a table. You can select the data and store it in another table for finding the missing data.

Select * from table1 as of timestamp(to_timestamp('2014-03-29 11:00:00','yyyy-mm-dd hh:mi:ss'))


Thursday, August 1, 2013

ASP.NET Tip : Reading and Writing CLOB Datatype column in Oracle

Problem : Read & Write CLOB Dataype Column in Oracle

Solution : Using Oracle Data Provider (ODP.NET)

Steps :

  • Install ODP.NET and use the below code

    Imports Oracle.DataAccess.Client
    Imports Oracle.DataAccess.Types

    ' Reading CloB Data

    Public Sub ReadLOBData()

    Dim con As New OracleConnection(connectionstring)


    Dim sql As String = "Select clb_field from Table1 where Id= 1"

    Dim cmd As OracleCommand = New OracleCommand(sql, con)
    Dim dr As OracleDataReader = cmd.ExecuteReader()

    Dim blob As OracleClob = dr.GetOracleClob(0)
    TextBox1.Text = blob.Value


    End Sub

    ' Writing CLOB Data

    Public Sub WriteLOBData()

    Dim connection As New OracleConnection(connectionstring)


    Dim strSQL As String = "INSERT INTO Table1 (ID,clb_field) VALUES (1 , :TEXT_DATA) "

    Dim paramData As New OracleParameter

    paramData.Direction = ParameterDirection.Input
    paramData.OracleDbType = OracleDbType.Clob
    paramData.ParameterName = "TEXT_DATA"

    paramData.Value = TextBox1.Text

    Dim cmd As New OracleCommand
    cmd.Connection = connection
    cmd.CommandText = strSQL

    paramData = Nothing
    cmd = Nothing

    End Sub