RSS
16 Feb 2007

And This is Still Needed, for God Sakes!

Author: ceefour | Filed under: Beginner, Complaints, Opinions, Rails, Ruby, Tips

This is far from being a Ruby post.

But it got me smiling (although evilly).

// set the shitty parameter stuff (I hate Crystal Reports!!!)
ParameterDiscreteValue pdv = new ParameterDiscreteValue();
pdv.Value = title;
workSessionsByEmployee.ParameterFields["RangeTitle"]
.CurrentValues =
new ParameterValues(new ParameterValue[] { pdv });
crystalReportViewer.ParameterFieldInfo =
workSessionsByEmployee.ParameterFields;
workSessionsReportTableAdapter.FillByRange(
absensiStainDataSet.WorkSessionsReport,
begin, end);
...
workSessionsByEmployee.SetDataSource(absensiStainDataSet);
...
private void crystalReportViewer_ReportRefresh(object source,
CrystalDecisions.Windows.Forms.ViewerEventArgs e) {
  // and this is still needed! For God sakes!!!
e.Handled = true;
}

Yes, it came from a client’s Visual Studio 2005 (C#) project that I wrote (pity who?), only a few months old. icon wink And This is Still Needed, for God Sakes!

What it does is filter the report based on a date range. Kinda’ painful to me. I scoured the net, MSDN, whatever, but that’s the best technique I could find at that time (that actually works).

I wonder how similar functionality could be implemented the Ruby way?

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

  • http://cpan.uwinnipeg.ca/~dns Daniel Sirait

    kok coding di Ruby repot bgt yah ??
    kenapa gak buat kyk begini:

    #!perl6 | perl | pugs
    $work = Work.new;
    $work.doThis;
    $q = $work.doThat;
    $q.JustDoIt;

    lalu buat definisikan fungsi yg diexport atau (juga coding di XS language supaya performace lebih cepat) di Work.pm & work.xs

    jadi dong …

    kok harus repot2 pake:
    crystalReportViewer.ParameterFieldInfo =
    workSessionsByEmployee.ParameterFields;
    workSessionsReportTableAdapter.FillByRange(
    absensiStainDataSet.WorkSessionsReport,
    begin, end);

    #

    yg lebih sadis, di Perl6 itu support MACRO & LAZY Evaluation & Functional & Pure OO, jadi codingan yg `Infinite`/ bakalan Valid krn adanya fitur LAZY evaluation !!

    coba aja:

    #!perl6 | pugs
    for 1..Inf {
    "Just another Perl 6 hacker".say
    }

    setahu saya bahasa pemrograman yg cuma support LAZY evaluation cuma Perl 6 dan Haskell deh :-)

    coba cek:
    http://cpan.uwinnipeg.ca/module/Inline::Ruby

    #!/usr/bin/perl -w

    use Inline Ruby =>

  • http://www.hendyirawan.web.id/ Hendy Irawan

    Mas Daniel,

    Yang Mas bilang “repot” itu kode C# di Visual Studio .NET 2005, bukan Ruby…. ;-)

  • http://bestjedimaster.blogspot.com/ Bos Jedi Master

    @daniel: yes, hidup haskell indonesia!
    @hendy: +1, ruby is a very very high level language