jueves, 25 de agosto de 2016

LinkedIn Background Image

Go to Google Image Search and search for anything you like to be your image background.

then use any capture screen software you like to capture the best combination you like,
I use screenshot captor
https://www.donationcoder.com/Software/Mouser/screenshotcaptor/

and no I am not getting any money for this :) I wish I could

here some examples:

Some Peruvian beaches



Do you like Software Companies?




and this is my current linkedin background



simple and nice. I am not a Graphic Designer so this approach will work for me.

lunes, 8 de agosto de 2016

Tsql Tips

Sometimes you need random numbers from 1 to 1000 and without duplicated numbers, here is the link:

http://sqlperformance.com/2013/09/t-sql-queries/random-collisions

Backup all databases at once from a SQL Server?
https://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/

Reindex all tables in a DB TSQL
http://blog.sqlauthority.com/2015/02/15/interview-question-of-the-week-007-how-to-reindex-every-table-of-the-database/


lunes, 25 de enero de 2016

Bulk Insert Notes

How to Fix Error : 
Msg 4866, Level 16, State 7, Line 2
The bulk load failed. The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly.
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 2
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".


Part of my format file is like this

10.0
59
1       SQLCHAR             2       20      ""   1     "RecordType"                        SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             2       50      ""   2     "FullName"                           SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             2       9       ""   3     "CompanyID"                         SQL_Latin1_General_CP1_CI_AS


Solution:
So I changed this "             2       " to "             0       "

10.0
59
1       SQLCHAR             0       20      ""   1     "RecordType"                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     "FullName"                           SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     "CompanyID"                          SQL_Latin1_General_CP1_CI_AS

Please notice the differences line per line 



/*****************************************************/
How to Fix Error : 
Msg 4823, Level 16, State 1, Line 3
Cannot bulk load. Invalid column number in the format file "C:\COMPANIES.fmt".

Format File is like this:

10.0
59
1       SQLCHAR             0       20      ""   1     [RecordType]                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     FullName                             SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     [CompanyID]                          SQL_Latin1_General_CP1_CI_AS
4       SQLCHAR             0       3       ""   4     [Column 3]                           SQL_Latin1_General_CP1_CI_AS

Solution:
Changed the Square Brackets for double quotes

10.0
59
1       SQLCHAR             0       20      ""   1     "RecordType"                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     FullName                             SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     "CompanyID"                          SQL_Latin1_General_CP1_CI_AS
4       SQLCHAR             0       3       ""   4     "Column 3"                           SQL_Latin1_General_CP1_CI_AS


/*****************************************************/
How to Fix Error : 
Msg 4862, Level 16, State 1, Line 3
Cannot bulk load because the file "C:\crane\COMPANIES.fmt" could not be read. Operating system error code (null).

Solution:
Open your format file press Ctrl-End you should be going to the last line.
If your last line is a column definition you need to go to the end of that line, press enter and Save it.
so you must have an EMPTY LAST LINE in your file.




lunes, 14 de diciembre de 2015

Rmcobol 85 tips

Couple of things.

I was looking for a copy of the manual.

https://www.yumpu.com/en/document/view/9317270/rm-cobol-users-guide-second-edition-micro-focus

I have several index files to convert to sequential you can do it in a batch this is the command line.

runcobol recover2 A="INDEXFILE.INX, SEQUENTIALFILE.TXT ,NOSUB"


jueves, 10 de diciembre de 2015

Export Data From Crystal Reports to Excel - Work Around

So I was requested to Export the Data from a Crystal Report to Excel with Headers.
This is a work around not the perfect solution. It worked for my request, maybe it will for you as well.

The report uses  a DataTable as DataSource.

What I did I export the DataTable as comma delimited  file using this method

DataTable2CSV - Saving a DataTable to a CSV file

http://www.devx.com/vb2themax/Tip/19703

Again it worked for me. I got the data and the Headers.

The Report was simple straight forward not a Master - Detail Report.


Operation not yet implemented - Crystal Reports

I have this problem when the users use EXPORT AS A PDF from a Crystal Report.
The solution was simple
Grab the Arial and Times Roman Font from a XP Machine put them into a Flash Drive and copy them to the machine you are getting the problem. That will fix it.

What causes this problem? Microsoft update the fonts and they are "not compatible" with CR.
A work around is changing all the Fonts in your report to something else, mmmmm User will not wait for that I will stick with the XP Solution. I can not upload them here but you can send me a email I will send them to you if you need them.

Have a good one


viernes, 4 de diciembre de 2015

Export a Crystal Reports Data to Excel

Simple.

 Private Sub btnLoadReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadReport.Click

        Try
            vLoadDataSet() 'load the datatable with the records

            Dim pr1 As New ParameterDiscreteValue
            pr1.Value = dtDateFrom.Value.ToShortDateString
            Dim pr2 As New ParameterDiscreteValue
            pr2.Value = dtDateTo.Value.ToShortDateString
            Dim pr3 As New ParameterDiscreteValue
            pr3.Value = txtTitle.Text

            Dim crSource As New RepMcLennanCCCriminalDocket
            crSource.SetDataSource(dtReport)

            crSource.SetParameterValue("pFrom", pr1)
            crSource.SetParameterValue("pTo", pr2)
            crSource.SetParameterValue("pTitle", pr3)



            crViewer.ReportSource = crSource
            crViewer.Refresh()
            crViewer.Visible = True
            crViewer.Show()


''here set the export
            crSource.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
            crSource.ExportOptions.ExportFormatType = ExportFormatType.ExcelRecord
            Dim objExcelOptions As ExcelFormatOptions = New ExcelFormatOptions
            objExcelOptions.ExcelTabHasColumnHeadings = True
            objExcelOptions.ExcelUseConstantColumnWidth = False
            crSource.ExportOptions.FormatOptions = objExcelOptions
            Dim objOptions As DiskFileDestinationOptions = New DiskFileDestinationOptions
            objOptions.DiskFileName = "SettingList.xls"
            crSource.ExportOptions.DestinationOptions = objOptions
''here export
            crSource.Export()

''here open the excel
            Process.Start("EXCEL.EXE", """SettingList.xls""")


        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
    End Sub